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

Ensure consistent country assignments #3516

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

lonvia
Copy link
Member

@lonvia lonvia commented Aug 15, 2024

When OSM data has areas with overlapping countries, use the country assignments from the pre-defined country grid for tie-breaking. If that fails, fall back to the country with the smaller partition number. It that still does not yield a distinct result, fall back to alphabetical order.

The latest version of the default country grid no longer contains overlapping areas and thus should nicely work as a tie-breaker for almost all cases. You can easily replace the defaults if the assignments in this file do not fit your use case. If you are still working with the older default country grid with overlapping areas, then the fallback is towards the smaller country.

The second fallback to ordering via partition number should roughly mean that larger countries tend to win. Again, you can change the number assignment for countries to change the order.

Fixes #3464.

When OSM data has areas with overlapping countries, use the country
assignments from the pre-defined country grid for tie-breaking.
If that fails, fall back to the country with the smaller partition
number.
@lonvia lonvia merged commit fdb3fc2 into osm-search:master Aug 15, 2024
11 checks passed
@lonvia lonvia deleted the fixed-country-order branch August 15, 2024 14:54
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.

Countries are assigned inconsistently when overlapping
1 participant