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

Warn when addr:*=* is added to a relation #10642

Open
gy-mate opened this issue Jan 2, 2025 · 9 comments
Open

Warn when addr:*=* is added to a relation #10642

gy-mate opened this issue Jan 2, 2025 · 9 comments
Labels
considering Not Actionable - still considering if this is something we want validation An issue with the validation or Q/A code

Comments

@gy-mate
Copy link

gy-mate commented Jan 2, 2025

Description

addr:*=* tags are not allowed on relations (except multipolygon relations):

Therefore, I think that iD should warn users when this "rule" isn't met.

Screenshots

N/A

@maro-21
Copy link

maro-21 commented Jan 2, 2025

Technically they can be added to relations, e.g. a building with an address in the relation type=multipolygon. Unless iD excludes only this relation.

onRelation=no on OSM Wiki means "on relations except multipolygon relations".

@gy-mate
Copy link
Author

gy-mate commented Jan 2, 2025

onRelation=no on OSM Wiki means "on relations except multipolygon relations".

Yeah, I meant it like that.

@tyrasd tyrasd added validation An issue with the validation or Q/A code help wanted For intermediate contributors, requires investigation or knowledge of iD code labels Jan 7, 2025
@tyrasd
Copy link
Member

tyrasd commented Jan 7, 2025

To some extent this is already addressed by the presets: presets for non-multipolygon relations should not have an address field. So only users who are using the raw tag editor should be affected and those users should be aware of the tagging rules. 😉 That said, it wouldn't hurt to add a validation rule for this, if someone wants to give it a shot.

@gy-mate
Copy link
Author

gy-mate commented Jan 7, 2025

So only users who are using the raw tag editor should be affected

Or JOSM users, like here. :)

those users should be aware of the tagging rules. 😉

Yeah, they should be, but unfortunately some make this mistake:

Screenshot 2025-01-07 at 11 28 50

And a warning in iD would help with cleaning up this mess.

@gy-mate
Copy link
Author

gy-mate commented Jan 7, 2025

it wouldn't hurt to add a validation rule for this, if someone wants to give it a shot.

@tyrasd I've found this list:

iD/modules/osm/tags.js

Lines 270 to 278 in b2b397c

export var osmMutuallyExclusiveTagPairs = [
['noname', 'name'],
['noref', 'ref'],
['nohousenumber', 'addr:housenumber'],
['noaddress', 'addr:housenumber'],
['noaddress', 'addr:housename'],
['noaddress', 'addr:unit'],
['addr:nostreet', 'addr:street']
];

However, this only specifies keys. And this validation rule should be like:

['type!=multipolygon', 'addr:housenumber'],
['type!=multipolygon', 'addr:housename'],

etc.

Is it possible to add these to an existing list? If not, could you please point me to the right direction?

Thank you in advance!

@Avan2021
Copy link

Avan2021 commented Jan 8, 2025

Can you please assign this issue to me if it is still open? I'd love to work on it.

@gy-mate
Copy link
Author

gy-mate commented Jan 8, 2025

@Avan2021 I don't have that option but you can work on it anyway!

@Avan2021
Copy link

Avan2021 commented Jan 8, 2025

@gy-mate do you think adding a new condition to osmMutuallyExclusiveTagPairs like
['type!=multipolygon', 'addr:housename'] mentioned above will be a good approach

@tyrasd
Copy link
Member

tyrasd commented Jan 8, 2025

🤔 Maybe let's step back a little bit before starting to work on it right away.

The thing with validations/warnings in iD is that they are not primarily meant to be a method to "clean up OSM data". Especially if the issues are primarily caused by (users of) other editors, these warnings could even be confusing and irritating for users of iD. iD tries to abstract away complicated concepts like relations wherever possible (e.g. by presets), so coming up with an easy to understand validation message would be critical if we want to add one in iD. An additional complication is that validation warnings in iD should be actionable. This is typically done by providing buttons to directly solve the issue: For example, the osmMutuallyExclusiveTagPairs warning offers the user to remove either of the two mutually exclusive tags. In the case of address tags on a relation, the potential fixes are quite varying (from removing the address tags, to extracting the address information into a dedicated address node, to changing the type of the relation, etc.), which again would be hard to understand for newcomers to OSM.

So, wouldn't it make more sense to tackle this problem on a different level: If this case would be included in a quality assurance tool like osmose, then it would be more generally visible than a validation warning only in iD, it would be more targeted as new users would not be "bothered", and experienced users could also get these warnings in iD by enabling the respective QA layer.

@tyrasd tyrasd added considering Not Actionable - still considering if this is something we want and removed help wanted For intermediate contributors, requires investigation or knowledge of iD code labels Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
considering Not Actionable - still considering if this is something we want validation An issue with the validation or Q/A code
Projects
None yet
Development

No branches or pull requests

4 participants