Handle the occupied Northern Cyprus boundary consistently across zoom levels#621
Open
candux wants to merge 2 commits into
Open
Handle the occupied Northern Cyprus boundary consistently across zoom levels#621candux wants to merge 2 commits into
candux wants to merge 2 commits into
Conversation
OSM models Cyprus's de facto regions at admin_level=3, including Northern Cyprus. The Northern Cyprus relation identifies its boundary with border_type=occupied but does not carry one of the dispute tags currently recognized by the boundaries layer, so its OSM output loses the disputed state when the source switches from Natural Earth at z6. Treat the exact admin_level=3 and border_type=occupied combination as a dispute signal. Preserve the OSM hierarchy as kind=region and kind_detail=3, while emitting disputed=true and sort_rank=288. Ordinary level 3 boundaries remain undisputed regional boundaries. Add regression coverage for both the occupied and ordinary level 3 cases. Verification: BoundariesTest, full Maven package (399 tests), Spotless, git diff --check, and a Cyprus PMTiles scan at z6-z10. AI assistance: this change was prepared with assistance from OpenAI Codex.
The bundled boundary style classifies line weight solely from kind_detail, so every level 3 boundary uses the thinner regional treatment. That creates a visible discontinuity for occupied or disputed de facto regions when low-zoom Natural Earth country boundaries give way to level 3 OSM boundaries. Include disputed level 3 features in the country-weight boundary layer and exclude the same features from the regional layer. Keep the filters complementary so each feature renders exactly once. Ordinary level 3 boundaries remain unchanged. This remains backward compatible in both directions: old styles continue to render new level 3 tiles as regional boundaries, while new styles render old tiles without a disputed attribute using the previous regional treatment. Add a regression test that locks down both boundary filters. Verification: all 11 style tests, TypeScript checking, Biome, MapLibre style validation, browser rendering, and git diff --check. AI assistance: this change was prepared with assistance from OpenAI Codex.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Overview
This PR addresses issue #511, where the Northern Cyprus boundary changes from disputed-country styling at low zoom to ordinary regional styling at higher zoom.
This PR marks the explicitly occupied OSM boundary as disputed and styles it consistently with its low-zoom representation.
The commits are backward-compatible when used independently. New PMTiles used with the old styles continue to render the boundary as before, and the updated styles used with old PMTiles also render it as before. Only combining both commits enables the new disputed-boundary treatment for Northern Cyprus.
Changes
1. Mark occupied level 3 boundaries as disputed
OSM relation 2514541 Northern Cyprus, is tagged:
Relations with the exact combination of admin_level=3 and border_type=occupied now receive disputed=true and the disputed sort_rank.
According to Taginfo, border_type=occupied currently occurs exactly once in OSM, on this relation. The rule therefore affects only Northern Cyprus with the current OSM data.
The boundary remains kind=region, kind_detail=3, following its OSM classification.
2. Style disputed level 3 boundaries prominently
The bundled styles now render boundaries with:
using the emphasized disputed-boundary treatment.
This removes the visual change around Cyprus when transitioning between the Natural Earth and OSM zoom levels.
Verification
Closing statement
I’m not sure whether a single border justifies all this. For some use cases, showing disputed borders correctly can be important. But there are many similar cases around the world with different tagging, and keeping OSM and Natural Earth consistent makes the problem even worse.
The cleaner fix would be a change in OSM, but changing disputed-boundary tagging there is a huge can of worms and may simply be a waste of time. I’ll leave it to the maintainers to decide whether this is worth it.
AI assistance
these changes and tests were prepared with help from OpenAI Codex.