Skip to content

Conversation

@k-yle
Copy link
Collaborator

@k-yle k-yle commented Dec 16, 2025

Previously discussed at openstreetmap/id-tagging-schema#1622 (comment)


Currently, if you change building=yes + building:levels=5 to landuse=grass, then the grass will still have building:levels, which is a bit weird.

There are endless examples like this. This topic has been discussed many times in different PRs. removeTags can solve this, but it's not clear when we should use removeTags.


New logic:

  • universal keys like name, check_data are always kept
  • keys that do not exist in the tagging schema are always kept, like ref:FR:some_random_tag
  • keys that are not used by the old preset are always kept
  • keys that exists in the old preset, but not in the new preset, are deleted.

@k-yle k-yle added preset An issue with an OpenStreetMap preset or tag id-tagging-schema An issue related to the id-tagging-schema repo labels Dec 16, 2025
@tordans
Copy link
Collaborator

tordans commented Dec 16, 2025

universal keys like name, check_data are always kept

Is this part in the code already?

@k-yle
Copy link
Collaborator Author

k-yle commented Dec 16, 2025

Is this part in the code already?

yeah, right now iD doesn't delete any fields when changing presets.

So the only change is to the 4th bullet point.

@tordans
Copy link
Collaborator

tordans commented Dec 16, 2025

If we release this, we should look into adding a recommendation in the docs (probably schema builder) to hint at other apps that this is the common handling of this case. (Note to self)

Copy link
Member

@tyrasd tyrasd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds like the most sensible thing do do.

I noticed that none of the tests seems to cover the case for a tag which does not exist in either preset… Shall we maybe add a test for that case while we're at it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

id-tagging-schema An issue related to the id-tagging-schema repo preset An issue with an OpenStreetMap preset or tag

Projects

None yet

4 participants