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

Reorganise handling of country names imported from OSM #2614

Merged
merged 5 commits into from
Feb 25, 2022

Conversation

lonvia
Copy link
Member

@lonvia lonvia commented Feb 24, 2022

Country names are special for Nominatim because they are their own kind of token. A basic set of country names comes from the static [data/country_name.sql] file. Additional names are imported from boundary=administrative relations with admin_level=4. The problem here is that the OSM names are only added to the word token table but never deleted. It's usually fine because these names rarely change. But when they are changed to something bogus, the wrong name stays in the database forever.

This PR introduces a clear separation between internal and imported names. country_name gets an extra field to save the names from OSM. Both name sets are then mixed on the fly when formatting output. The internal names are also marked in the word token table. Whenever changes to the OSM boundaries come in, only the tokens not marked are updated. This allows to delete the ones that are no longer in the OSM relation.

As an additional precaution against editing mistakes, only the largest relation of a certain country can contribute country names.

Fixes #2611.

This allows us to distinguish between base names and imported ones
and consiquently removing imported ones if necessary.
This uncovered a couple of outdated/wrong tests which have been
fixed, too.
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

Successfully merging this pull request may close these issues.

Wrong country name - Ukraine
1 participant