Skip to content

Handle the occupied Northern Cyprus boundary consistently across zoom levels#621

Open
candux wants to merge 2 commits into
protomaps:mainfrom
candux:fix/cyprus-occupied-boundary
Open

Handle the occupied Northern Cyprus boundary consistently across zoom levels#621
candux wants to merge 2 commits into
protomaps:mainfrom
candux:fix/cyprus-occupied-boundary

Conversation

@candux

@candux candux commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

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:

admin_level=3
border_type=occupied
boundary=administrative

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:

kind_detail=3
disputed=true

using the emphasized disputed-boundary treatment.

This removes the visual change around Cyprus when transitioning between the Natural Earth and OSM zoom levels.

Verification

  • Added regression tests for occupied and ordinary level 3 relations.
  • Added style filter coverage for disputed level 3 boundaries.
  • Generated and visually inspected a Cyprus PMTiles extract.
  • Full Maven package: 399 tests passed.
  • Style tests, TypeScript, Biome, Spotless, and git diff --check passed.

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.

candux added 2 commits July 10, 2026 13:11
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.
@sonarqubecloud

Copy link
Copy Markdown

@candux candux changed the title Fix disputed boundary handling for occupied and claimed territories Handle the occupied Northern Cyprus boundary consistently across zoom levels Jul 10, 2026
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.

1 participant