Water polygons cross national borders and two partitions draw the same lake — 1 438 km² doubled at the SE/FI border #197

Open
opened 2026-08-20 19:58:24 +00:00 by art-bot · 0 comments
Collaborator

Found while reviewing !195 (Greece's water_bodies), but it is not a Greece
problem and not a water_bodies problem — it is what happens when a feature that
crosses a national border meets a table partitioned by country. Greece is only
where it was visible, because Prespa is 86% not Greek. Sweden and Finland are
already drawing 1 438 km² of the same water twice, today, on the live map.

Measured

Area of each country's map_water_bodies_14 partition falling outside that
country's own map_country_mask_0, over polygons larger than 5 km²
(EPSG:3857 areas, the unit these tables are in):

country polygons outside km² outside straddling (part in, part out) wholly outside
pl 3 3 934 1 2
fi 74 857 27 47
se 44 613 0 44
gr 3 470 3 0
is 0 0 0 0

Iceland is the control: no land neighbour, nothing outside. Poland's 3 934 km²
is almost entirely Morze Bałtyckie, the Baltic slab mislabelled as a lake —
that is #43 and not this issue.

The two remaining classes are different failures and want different fixes:

Straddling — one real feature shared with a neighbour. Greece: ΛΙΜΝΗ ΜΕΓΑΛΗ
ΠΡΕΣΠΑ (493 km², 423 outside — Albania and North Macedonia), ΛΙΜΝΗ ΔΟΪΡΑΝΗ (69,
39 outside), ΛΙΜΝΗ ΜΙΚΡΗ ΠΡΕΣΠΑ (83, 8). The WFD publishes a lake water body as
one polygon regardless of which state it lies in, so the whole lake arrives.
Verified against gr_perifereies (the administrative extent, inland water
included), not just the mask; interior lakes come back 0 km² outside, which is
the control for the measurement. Finland's 27 straddlers (116 km²) sit at
68.7°N / 25.2°E — the Torne–Muonio–Könkämä border chain.

Wholly outside — a polygon entirely on the other side of its own mask.
Sweden 44 (613 km²) at 67.4°N / 23.1°E, Finland 47 (736 km²) at 67.0°N /
24.9°E: the same corridor, mirrored. This is not shared water, it is each
country's source and each country's mask disagreeing about where the border
runs, or coastal/archipelago water that the mask does not cover.

It is already visible, and it is not additive

In the SE/FI border box (19–27°E, 65–70°N), 745 polygon pairs from the two
partitions overlap, 1 438 km² of doubly-drawn water.
Decoded tile
zxy_map(11, 1142, 475) over Kilpisjärvi: water_bodies features=49 — 38 from
se, 10 from fi, of which 24 pairs overlap inside that one tile, 94 km².
The largest overlaps are at 68.5–69.0°N / 20.7–22.0°E, the Treriksröset corner.

Water is one colour, so two stacked polygons look like one — which is exactly
why this has survived. What it costs: every such feature is paid for twice in
tile bytes and in the generalization cascade, and the moment a shared feature is
named it is labelled twice by two partitions that cannot see each other.
Greece's lakes are all named; Albania is simply not imported yet, so the label
collision is scheduled rather than absent.

Why it is a shared-table question, not a per-country one

There is one zxy_map_water_bodies reading every country's parent tables, so
"whose lake is this" has no answer inside a single country config — which is the
same shape as the problem docs/unification.md Workstream B exists for, and the
water form of the question the world carve asks for land (#186: at a coast we
must carve, at a land border we must not, and the data cannot tell them apart).

Options, none of them free

  • Clip every layer to its own country mask. Correct ownership, and it puts a
    straight edge through open water where no edge exists — Prespa would end
    mid-lake at the border. Also needs a mask good enough to clip against, which
    is the #186 problem again.
  • Keep whole features, dedupe at the tile query. Nothing to invent
    geometrically, but it needs a rule for which partition wins, and the tile
    function currently unions partitions without looking at them.
  • Declare an owner per shared feature at import time (the country whose
    intersection is largest, say), and let the others drop it. Cheap to compute,
    survives a neighbour being added later, and is a real decision recorded in the
    data rather than a rendering trick.
  • Do nothing deliberately, i.e. write down that shared water is drawn by
    every country that has it. Honest, and it makes the label duplication a known
    cost rather than a surprise.

Whatever the answer, it wants an acceptance test that fails when a country's
partition carries area outside its own mask beyond a documented allowance —
today that test would go red for four of the five countries, which is the point.

Not in scope

  • #43 (Poland's Baltic slab as a lake) — a classification bug that this
    measurement happens to rank first.
  • The cover, roads, railways and waterways layers were not measured. The
    same question applies to every one of them; a border river's centreline is the
    obvious next case.

Measured 2026-08-20 against the live database, after !194 and !195 merged
(main ebdaa34).

Found while reviewing !195 (Greece's water_bodies), but it is not a Greece problem and not a water_bodies problem — it is what happens when a feature that crosses a national border meets a table partitioned by country. Greece is only where it was visible, because Prespa is 86% not Greek. **Sweden and Finland are already drawing 1 438 km² of the same water twice, today, on the live map.** ## Measured Area of each country's `map_water_bodies_14` partition falling outside that country's own `map_country_mask_0`, over polygons larger than 5 km² (EPSG:3857 areas, the unit these tables are in): | country | polygons outside | km² outside | straddling (part in, part out) | wholly outside | |---|---|---|---|---| | pl | 3 | 3 934 | 1 | 2 | | fi | 74 | 857 | **27** | 47 | | se | 44 | 613 | **0** | 44 | | gr | 3 | 470 | **3** | 0 | | is | 0 | 0 | 0 | 0 | Iceland is the control: no land neighbour, nothing outside. Poland's 3 934 km² is almost entirely `Morze Bałtyckie`, the Baltic slab mislabelled as a lake — that is #43 and **not** this issue. The two remaining classes are different failures and want different fixes: **Straddling — one real feature shared with a neighbour.** Greece: ΛΙΜΝΗ ΜΕΓΑΛΗ ΠΡΕΣΠΑ (493 km², 423 outside — Albania and North Macedonia), ΛΙΜΝΗ ΔΟΪΡΑΝΗ (69, 39 outside), ΛΙΜΝΗ ΜΙΚΡΗ ΠΡΕΣΠΑ (83, 8). The WFD publishes a lake water body as one polygon regardless of which state it lies in, so the whole lake arrives. Verified against `gr_perifereies` (the administrative extent, inland water included), not just the mask; interior lakes come back 0 km² outside, which is the control for the measurement. Finland's 27 straddlers (116 km²) sit at 68.7°N / 25.2°E — the Torne–Muonio–Könkämä border chain. **Wholly outside — a polygon entirely on the other side of its own mask.** Sweden 44 (613 km²) at 67.4°N / 23.1°E, Finland 47 (736 km²) at 67.0°N / 24.9°E: the same corridor, mirrored. This is not shared water, it is each country's source and each country's mask disagreeing about where the border runs, or coastal/archipelago water that the mask does not cover. ## It is already visible, and it is not additive In the SE/FI border box (19–27°E, 65–70°N), **745 polygon pairs from the two partitions overlap, 1 438 km² of doubly-drawn water.** Decoded tile `zxy_map(11, 1142, 475)` over Kilpisjärvi: `water_bodies features=49` — 38 from `se`, 10 from `fi`, of which **24 pairs overlap inside that one tile, 94 km²**. The largest overlaps are at 68.5–69.0°N / 20.7–22.0°E, the Treriksröset corner. Water is one colour, so two stacked polygons look like one — which is exactly why this has survived. What it costs: every such feature is paid for twice in tile bytes and in the generalization cascade, and the moment a shared feature is *named* it is labelled twice by two partitions that cannot see each other. Greece's lakes are all named; Albania is simply not imported yet, so the label collision is scheduled rather than absent. ## Why it is a shared-table question, not a per-country one There is one `zxy_map_water_bodies` reading every country's parent tables, so "whose lake is this" has no answer inside a single country config — which is the same shape as the problem `docs/unification.md` Workstream B exists for, and the water form of the question the world carve asks for land (#186: at a coast we must carve, at a land border we must not, and the data cannot tell them apart). ## Options, none of them free - **Clip every layer to its own country mask.** Correct ownership, and it puts a straight edge through open water where no edge exists — Prespa would end mid-lake at the border. Also needs a mask good enough to clip against, which is the #186 problem again. - **Keep whole features, dedupe at the tile query.** Nothing to invent geometrically, but it needs a rule for which partition wins, and the tile function currently unions partitions without looking at them. - **Declare an owner per shared feature at import time** (the country whose intersection is largest, say), and let the others drop it. Cheap to compute, survives a neighbour being added later, and is a real decision recorded in the data rather than a rendering trick. - **Do nothing deliberately**, i.e. write down that shared water is drawn by every country that has it. Honest, and it makes the label duplication a known cost rather than a surprise. Whatever the answer, it wants an acceptance test that fails when a country's partition carries area outside its own mask beyond a documented allowance — today that test would go red for four of the five countries, which is the point. ## Not in scope - #43 (Poland's Baltic slab as a lake) — a classification bug that this measurement happens to rank first. - The `cover`, `roads`, `railways` and `waterways` layers were not measured. The same question applies to every one of them; a border river's centreline is the obvious next case. Measured 2026-08-20 against the live database, after !194 and !195 merged (main `ebdaa34`).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
art/ismap#197
No description provided.