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

Remove all alt name variants when dropping names #2039

Open
nvkelso opened this issue Dec 20, 2021 · 1 comment
Open

Remove all alt name variants when dropping names #2039

nvkelso opened this issue Dec 20, 2021 · 1 comment
Milestone

Comments

@nvkelso
Copy link
Member

nvkelso commented Dec 20, 2021

In some cases when when we ask in queries.yaml to drop_properties and include the all_name_variants config, we still see alt_name variants.

image

The transform we use is:

def _is_name(key):
"""
Return True if this key looks like a name.
This isn't as simple as testing if key == 'name', as there are alternative
name-like tags such as 'official_name', translated names such as 'name:en',
and left/right names for boundaries. This function aims to match all of
those variants.
"""
# simplest and most common case first
if key == 'name':
return True
# translations next
if key.startswith('name:'):
return True
# then any of the alternative forms of name
return any(key.startswith(p) for p in tag_name_alternates)

    # then any of the alternative forms of name
    return any(key.startswith(p) for p in tag_name_alternates)

Which uses a list of alternate name tags:

tag_name_alternates = (
'int_name',
'loc_name',
'nat_name',
'official_name',
'old_name',
'reg_name',
'short_name',
'name_left',
'name_right',
'name:short',
)

So the action to take is to expand the list to include alt_name.

@nvkelso nvkelso added this to the v1.9.0 milestone Dec 20, 2021
@nvkelso
Copy link
Member Author

nvkelso commented Dec 20, 2021

Build a test using https://www.openstreetmap.org/relation/3987743.

@nvkelso nvkelso modified the milestones: v1.9.0, v2.0.0 Apr 29, 2022
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