Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecated.json: allow more strict matching rules for values of semicolon-separated tags #39

Open
tyrasd opened this issue Jan 24, 2022 · 0 comments

Comments

@tyrasd
Copy link
Collaborator

tyrasd commented Jan 24, 2022

Sometimes, upgrade paths need to handle semicolon-separated tags differently depending if only a single value is present or a combination of multiple values. For example consider the following situation:

  • old_tag=a ➡️ new_tag=x + new_sub_tag=a
  • old_tag=b ➡️ new_tag=x + new_sub_tag=b
  • old_tag=a;b ➡️ new_tag=x

Such a tagging upgrade is currently (in general) not possible to implement using the deprecated.json and/or preset replacement mechanisms. The first because multiple upgrade paths will match the a;b value, causing the new_sub_tag to be incorrectly added in the result. The preset replacement mechanism does not work if there is only a single preset for new_tag=x (and a field for new_sub_tag).

See openstreetmap/id-tagging-schema#365 (comment) for a case where such a bug occurred.

One solution would be to allow the matching of old tags to be more strict, e.g. by being able to indicate that semicolon-separated values should not be considered. Possible syntax:

  {
    "old": {"old_tag": "a"},
    "matchSemicolonSeparatedValues": false,
    "replace": {"new_tag": "x", "new_sub_tag": "a"}
  },

The property could also be called "match": "exact" to be a bit more concise.

The downside of this approach would be that it would not be backwards compatible with older versions of iD (once it is implemented). 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant