BDOT10k mislabels 5 845 km² of the Baltic as a lake (source bug, not ours) #43
Labels
No labels
blocked
claude-wip
map-report
map:is
map:se
needs-review
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
art/ismap#43
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Noticed while measuring #36. The mislabelling is in BDOT10k, not in our import — worth
saying up front, because the shape of it looks exactly like a botched union on our side.
What
map_water_bodies_<z>carries a 5 845 km² polygon named Morze Bałtyckie, classedlake. It is the largest "lake" in the database by a factor of 29 and it is a chunk of theBaltic.
conf/plmap.yaml'swater_bodiesquery isWHERE rodzaj <> 'woda morska'and mapseverything surviving to
river(woda płynąca) orlake. That is correct, and the sourceis what is wrong. In the
pl_ptwpstaging table, loaded natively from the countyGeoPackages with nothing of ours applied:
Sixteen rows say marine, one says standing water. The odd one out is teryt 3209
(powiat koszaliński), centroid 54.56 N 15.79 E, and it lies 426 m from Jezioro Jamno —
which is the lagoon just north of Koszalin that is very nearly touching the sea. So the
guess that the lake infected the sea with its lakeness is probably right, and it happened
upstream of us: one county's delivery has a slab of the Baltic attributed as woda
stojąca.
Why it matters a little
data-quality and attribute-correctness problem, not a rendering one.
km² of polygon in every
water_bodiestile along that coast.water_class— a label, amarine/inlandsplit, anarea statistic — gets it wrong. #40's bridging work reads this layer.
Options, in increasing order of dishonesty
reproduction.
water_bodiespolygons that touchthe country mask's seaward edge. Principled, and would catch the next one.
Morze Bałtyckie. One line, effective, and the kind of hard-coded patchthat
conf/semap.yaml's objekttypnr 2648 comment warns about: theINlist that drivesthe
WHEREis the same list theCASEbranches on precisely so an unmapped case dropsout visibly instead of being painted the wrong colour. A name check would be the
opposite of that.
Worth checking whether the same row also reaches
cover(which reads the samepl_ptwpstaging table, unioned per class per county) before picking one —
covermaps PTWP to itsown water classes by a different route and may or may not inherit the same error.
Measured again while porting R58's acceptance test (#123, 2026-08-16): the mislabel is still standing in the current delivery, slightly smaller than the original report — the
woda stojącaslab is 1 971 km² in EPSG:2180 (5 845 km² in 3857, teryt 3209, centroid 54.56 N 15.79 E), and it is still the largest "lake" in the database by 29× (Śniardwy is 200 km² in 3857). It survives to z3 (it is the lone row of map_water_bodies_3_pl) and shares 49 km of edge with the national boundary (poland_mask). It also reachescoveras a 5 845 km²water_body(R59 — the same pl_ptwp source, different route; cover's sea/water_body classes render the same colour so it is invisible on the map either way).The fix #123's test needs, in the project's idiom (#43's option 2, "exclude by geometry"):
water_bodiesquery: add to the WHERE — drop anywoda stojącarow that is an order-of-magnitude area outlier for the class AND intersects the mask's boundary:ST_Area(geom) > 10 * (second-largest woda stojąca area)ANDST_Intersects(ST_Transform(ST_Boundary(poland_mask.geom), 2180), geom). This drops exactly the slab (measured: nothing else in pl_ptwp satisfies both).cover's PTWP source: same predicate as an extra CASE arm →'sea'instead of'water_body'(a drop would leave a hole in the coverage; reclassifying keeps the partition complete).water_bodies(cheap) andcover(the heavy one; Poland's cover cascade is ~1.5–2 h — a separate step if preferred).The acceptance test that guards it (ships in the fix PR, the #120 pattern):
Verified failing against the live DB today (outliers=1, Morze Bałtyckie=5845 km2); after the fix it passes. It belongs on the
water_bodieslayer inconf/plmap.yamlwithrequires: [map_water_bodies_14_<cc>, poland_mask]. #123's note records the same spec; also note the water_bodies R119 test in #123 asserts z4–z14 so it survives this fix (z3 becomes the deliberate empty, like every other country).