openstreetmap-ng icon indicating copy to clipboard operation
openstreetmap-ng copied to clipboard

Implicit discardable tags

Open Zaczero opened this issue 1 year ago β€’ 5 comments

When processing new changes, we want to automatically discard certain tags so clients don't have too. JOSM and iD already implement such features but we should apply it globally for simplicity.

The goal is to:

  • efficiently discard certain tags during tagsvalidating validation function (it should return modified dict of tags), see models/validating/tags
  • migrate rules from JOSM and iD

I think if the discard method is simple enough (which is very likely), it should be a part of the validating model file.

Zaczero avatar Aug 10 '24 15:08 Zaczero

More info at OSM Wiki including references to iD/JOSM

starsep avatar Aug 10 '24 19:08 starsep

Is it enough to modify the tags instance passed as a parameter to the validate_tags method, or do we need to make a copy of all the tags?

docentYT avatar Aug 14 '24 15:08 docentYT

It's okay to modify it inplace

Zaczero avatar Aug 14 '24 16:08 Zaczero

I found that the same validation also takes place for changesets, which may include tags such as created_by.

docentYT avatar Aug 14 '24 16:08 docentYT

Good catch, let's focus on validating elements only, then. Maybe it’s possible to do this within ElementValidating?

Zaczero avatar Aug 14 '24 20:08 Zaczero