conf/gr: the water_bodies layer — the 73 WFD lakes (issue #192) #195

Merged
art-bot merged 3 commits from issue-192-gr-water-bodies into main 2026-08-20 19:17:20 +00:00
Owner

Closes #192


conf/gr: the water_bodies layer — the 73 WFD lakes (issue #192)

What and why

Greece's partition of the shared map_water_bodies_<z> tables, from the
catalogue's water_bodies row: gr_lwb_50k_greece, the ΥΠΕΝ WFD lake water
bodies — 73 polygons, every one named in Greek via wb_name_el (72 distinct
names; ΦΡΑΓΜΑ ΦΑΝΕΡΩΜΕΝΗΣ is a reservoir name carried by two lakes in
different districts).

The catalogue promised "lakes + river systems"; the layer is lakes only, and
the catalogue is corrected to match the geometry.
The #171 row said
gr_lwb_50k_greece lakes + gr_rwb_50k_greece river systems, but the river
systems are line features — all 1415 MultiLineStrings, verified in the raw
GeoJSON and against the floods_rev1 gr_rwb_greece_2rev layer too. The shared
contract declares geom: polygon, so gr_rwb cannot populate this layer, and
buffering the lines into fake areas would be inventing geometry the source
does not distinguish (R137). The rivers are already on the map: waterways
draws them as centrelines from the same official family (floods_rev1
hntw/hntz, #182), and gr_rwb itself serves that layer as the R92 name join.
So the layer is the 73 lakes, class lake, and nothing else; docs,
downloads.yaml and staging.yaml now say so.

Names as delivered. The source prints ALL CAPS Greek (ΛΙΜΝΗ ΜΕΓΑΛΗ
ΠΡΕΣΠΑ), kept verbatim for the same reason the stations layer (#179) keeps
its names: Greek lowercase carries tonos accents that uppercase loses, so a
case pass needs an accent-restoring dictionary — initcap produces accentless
"Λιμνη Μεγαλη Πρεσπα" — and the register-based casing pass Finland uses (R94)
does not exist for Greece yet. R7 already de-risked the Greek glyph stack
(#173).

No min_width_pixels. That knob exists to drop sub-pixel-wide RIVER
polygons, gated on the waterways centreline still drawing them (R53). This
layer has no river class — nothing thin to drop, no gate to meet.
min_area_pixels: 4 (the shared floor) thins by size alone.

Numbering. 09-water_bodies.yaml: the 07/08 slots are claimed by the
open places (#190) and transit (#194) PRs; appending next-free matches the
driver's convention. The layer reads only the staged lakes, so its build
order is free.

Verification

  • Config/import: make build, go test ./..., config-check conf/gr OK
    (7 layers, 41 acceptance tests), check-queries conf/gr 8/8 prepared.
  • Live DB (per-zoom rows in the gr partition): z14 76, z13 73, z12 73,
    z11 73, z10 73, z9 68, z8 57, z7 38, z6 22, z5 6, z4 1, z3 0 — the
    deliberate empty (4-px² floor at z3 is 1531 km² > Prespa's 493 km²; z4's
    383 km² floor keeps exactly Prespa). z14 = the 76 ST_Dumped parts of the 73
    source features (3 multipart lakes), all water_class = 'lake', all named,
    0 NULLs, 0 invalid geometries in the source.
  • Decoded tile: scripts/mvt-decode.py on zxy_map(13, 4571, 3078)
    (over Prespa) — water_bodies present with 1 feature; tiles --check conf/gr PASS for water_bodies at z3 and z14 with keys
    [water_class name country] (R121).
  • Real-browser render (cdp-map-check.mjs, no virtual time): at
    ?map=gr#12/40.80/20.93 the page renders 7 water_bodies features and the
    label ΛΙΜΝΗ ΜΕΓΑΛΗ ΠΡΕΣΠΑ is present (queryRenderedFeatures over the
    water_bodies layer). Console 404s are pre-existing on every country map
    (same on se) — not from this layer.
  • Acceptance: gr 41/41 with --acceptance all (was 39; +2 new tests).
    make acceptance full run: is 38/38, se 44/45 (1 needs -acceptance all),
    fi 49/49, world 27/28 (same not-run), pl 44/46 — the pl failure is the
    pre-existing marginal buildings R120 10s timeout, identical to the
    dd21ac2 baseline (recorded in the #191 note).

New acceptance tests (both on the layer, conf/gr/09-water_bodies.yaml)

  • R119: no water_bodies zoom table is empty (z4–z14; z3 the deliberate
    empty)
    — the standard per-country R119 shape, gr table names.
  • R11/R137: every WFD lake water body reaches the z14 partition, class
    lake, all named, the biggest lake is on the map
    — the waterways
    district-test arithmetic style: z14 rows (76) = ST_Dump count over gr_lwb
    (76), 0 non-lake, 0 unnamed, ΛΙΜΝΗ ΜΕΓΑΛΗ ΠΡΕΣΠΑ present.

Left undone / notes

  • conf/gr is still absent from importer/configdir_test.go's
    countryLayers map and config_test.go's countryConfigPaths
    — a
    pre-existing gap (Greece was never added; the two open gr PRs don't touch
    the maps either). Adding gr there now would go red the moment places/transit
    merge without updating the map, so it stays a separate cleanup; a candidate
    for a small follow-up issue.
  • No source downloads were needed (gr_lwb was already staged by #182).
Closes #192 --- # conf/gr: the water_bodies layer — the 73 WFD lakes (issue #192) ## What and why Greece's partition of the shared `map_water_bodies_<z>` tables, from the catalogue's `water_bodies` row: `gr_lwb_50k_greece`, the ΥΠΕΝ WFD lake water bodies — 73 polygons, every one named in Greek via `wb_name_el` (72 distinct names; ΦΡΑΓΜΑ ΦΑΝΕΡΩΜΕΝΗΣ is a reservoir name carried by two lakes in different districts). **The catalogue promised "lakes + river systems"; the layer is lakes only, and the catalogue is corrected to match the geometry.** The #171 row said `gr_lwb_50k_greece lakes + gr_rwb_50k_greece river systems`, but the river systems are **line features** — all 1415 MultiLineStrings, verified in the raw GeoJSON and against the floods_rev1 `gr_rwb_greece_2rev` layer too. The shared contract declares `geom: polygon`, so gr_rwb cannot populate this layer, and buffering the lines into fake areas would be inventing geometry the source does not distinguish (R137). The rivers are already on the map: `waterways` draws them as centrelines from the same official family (floods_rev1 hntw/hntz, #182), and gr_rwb itself serves that layer as the R92 name join. So the layer is the 73 lakes, class `lake`, and nothing else; docs, downloads.yaml and staging.yaml now say so. **Names as delivered.** The source prints ALL CAPS Greek (ΛΙΜΝΗ ΜΕΓΑΛΗ ΠΡΕΣΠΑ), kept verbatim for the same reason the stations layer (#179) keeps its names: Greek lowercase carries tonos accents that uppercase loses, so a case pass needs an accent-restoring dictionary — initcap produces accentless "Λιμνη Μεγαλη Πρεσπα" — and the register-based casing pass Finland uses (R94) does not exist for Greece yet. R7 already de-risked the Greek glyph stack (#173). **No `min_width_pixels`.** That knob exists to drop sub-pixel-wide RIVER polygons, gated on the waterways centreline still drawing them (R53). This layer has no river class — nothing thin to drop, no gate to meet. `min_area_pixels: 4` (the shared floor) thins by size alone. **Numbering.** `09-water_bodies.yaml`: the 07/08 slots are claimed by the open places (#190) and transit (#194) PRs; appending next-free matches the driver's convention. The layer reads only the staged lakes, so its build order is free. ## Verification - **Config/import**: `make build`, `go test ./...`, `config-check conf/gr` OK (7 layers, 41 acceptance tests), `check-queries conf/gr` 8/8 prepared. - **Live DB** (per-zoom rows in the gr partition): z14 76, z13 73, z12 73, z11 73, z10 73, z9 68, z8 57, z7 38, z6 22, z5 6, z4 1, **z3 0** — the deliberate empty (4-px² floor at z3 is 1531 km² > Prespa's 493 km²; z4's 383 km² floor keeps exactly Prespa). z14 = the 76 ST_Dumped parts of the 73 source features (3 multipart lakes), all `water_class = 'lake'`, all named, 0 NULLs, 0 invalid geometries in the source. - **Decoded tile**: `scripts/mvt-decode.py` on `zxy_map(13, 4571, 3078)` (over Prespa) — `water_bodies` present with 1 feature; `tiles --check conf/gr` PASS for water_bodies at z3 and z14 with keys `[water_class name country]` (R121). - **Real-browser render** (cdp-map-check.mjs, no virtual time): at `?map=gr#12/40.80/20.93` the page renders 7 water_bodies features and the label `ΛΙΜΝΗ ΜΕΓΑΛΗ ΠΡΕΣΠΑ` is present (queryRenderedFeatures over the `water_bodies` layer). Console 404s are pre-existing on every country map (same on se) — not from this layer. - **Acceptance**: gr **41/41** with `--acceptance all` (was 39; +2 new tests). `make acceptance` full run: is 38/38, se 44/45 (1 needs `-acceptance all`), fi 49/49, world 27/28 (same not-run), pl 44/46 — the pl failure is the **pre-existing** marginal buildings R120 10s timeout, identical to the dd21ac2 baseline (recorded in the #191 note). ## New acceptance tests (both on the layer, conf/gr/09-water_bodies.yaml) - **R119: no water_bodies zoom table is empty (z4–z14; z3 the deliberate empty)** — the standard per-country R119 shape, gr table names. - **R11/R137: every WFD lake water body reaches the z14 partition, class lake, all named, the biggest lake is on the map** — the waterways district-test arithmetic style: z14 rows (76) = ST_Dump count over gr_lwb (76), 0 non-lake, 0 unnamed, ΛΙΜΝΗ ΜΕΓΑΛΗ ΠΡΕΣΠΑ present. ## Left undone / notes - **`conf/gr` is still absent from `importer/configdir_test.go`'s `countryLayers` map and `config_test.go`'s `countryConfigPaths`** — a pre-existing gap (Greece was never added; the two open gr PRs don't touch the maps either). Adding gr there now would go red the moment places/transit merge without updating the map, so it stays a separate cleanup; a candidate for a small follow-up issue. - No source downloads were needed (gr_lwb was already staged by #182).
Greece's partition of the shared map_water_bodies_<z> tables, from the
catalogue's water_bodies row: gr_lwb_50k_greece, the ΥΠΕΝ WFD lake water
bodies — 73 polygons, all named in Greek via wb_name_el (72 distinct names;
ΦΡΑΓΜΑ ΦΑΝΕΡΩΜΕΝΗΣ is a reservoir name carried by two lakes in different
districts).

THE CATALOGUE IS CORRECTED HERE, NOT JUST BUILT: the #171 row promised
"lakes + river systems", but the WFD river systems (gr_rwb, and the
floods_rev1 gr_rwb_greece_2rev copy) are line features — all 1415
MultiLineStrings, no polygon anywhere. The shared contract declares
geom: polygon, so gr_rwb cannot populate this layer, and buffering the
lines into fake areas would be inventing geometry the source does not
distinguish (R137). The rivers are already on the map as waterways
centrelines (#182), which gr_rwb serves as the R92 name join. So the
layer is lakes only, class lake; docs/country-gr.md, downloads.yaml and
staging.yaml are corrected to say so.

Names as delivered (ALL CAPS Greek), same decision as the stations layer
(#179): Greek lowercase carries tonos accents uppercase loses, initcap
would produce accentless worse forms, and the R94 register casing pass
does not exist for Greece. No min_width_pixels: that knob is the R53-gated
river-polygon dropper and there are no river polygons. min_area_pixels 4
(the shared floor) thins by size alone; z3 is the deliberate empty (floor
1531 km² > Prespa 493 km²), z4 holds exactly Prespa (383 km² floor).

Live verification: z14 76 rows = the ST_Dumped parts of the 73 features,
all class lake, all named, 0 NULL; z13–z10 73, z9 68, z8 57, z7 38, z6 22,
z5 6, z4 1, z3 0. Decoded z13 tile over Prespa shows water_bodies; tiles
--check conf/gr PASS (R121); real-browser render at #12/40.80/20.93 draws
the layer and the ΛΙΜΝΗ ΜΕΓΑΛΗ ΠΡΕΣΠΑ label. Acceptance gr: 41/41 with
--acceptance all (+2 tests: the R119 no-empty-zoom-table and the R11/R137
source-truth arithmetic in the waterways district-test style).
Review of !195. Both findings are the same shape: the arithmetic was
right and the sentence built on it was not.

"GREECE'S LARGEST LAKE (ΜΕΓΑΛΗ ΠΡΕΣΠΑ, 493 km²)" IS WRONG TWICE. 493 km²
is an EPSG:3857 area at 40.8°N, where Mercator inflates area by
sec²(lat) = 1.75; the lake is 281 km² on the ground. And it is not
Greece's: the WFD publishes a lake water body as one polygon regardless
of which state it lies in, so this one arrives entire and 423 of those
493 km² — 86% — lie outside the Greek administrative extent, in Albania
and North Macedonia. Measured against gr_perifereies, not the land
outline, so inland water is included and the number means what it says;
interior lakes come back 0 km² outside, which is the control. Two more
do the same: ΔΟΪΡΑΝΗ (69 km², 39 outside) and ΜΙΚΡΗ ΠΡΕΣΠΑ (83 km², 8).
Greece's largest lake that is only Greek is ΤΡΙΧΩΝΙΔΑ, 96 km² on the
ground.

The floors themselves are untouched and still correct — the generalizer
compares projected area against projected pixel area, so 4 px² at z3 is
1531 km² in the same unit as the 493, and z3 stays the deliberate empty.
Only the labels change, plus a note saying which unit everything on that
comment is in. The test that asserts the biggest polygon is on the map
now calls it the set's biggest polygon rather than the country's biggest
lake.

~470 km² of neighbours' water in Greece's partition of a shared table is
a decision, not an accident, and it is now written down as one: drawing
the whole lake is right (cutting it at the border would put a straight
edge through open water), and when Albania or North Macedonia is
imported the same lake arrives from the other side and the partitions
overlap. That is the water form of the question the mask carve asks for
land — docs/country-gr.md *Water*, cross-referenced to #186 and
Workstream B.

Also: the z14 row-count test dumped ST_Dump(geom) while the layer query
dumps ST_Dump(ST_MakeValid(geom)). Identical today (76 = 76), but
ST_MakeValid can split a self-intersecting polygon into more parts, and
then the test would have failed for a reason that has nothing to do with
the layer. Mirrored.

And the `places` row said GO though #190 landed the layer — the verdict
table was never updated when it merged; the tally now reads seven plus
stations. (The transit PR carries the identical edit, so the two merge
without a conflict there.)

Verified on the live database: acceptance conf/gr --acceptance all 41/41
(0 failed, 0 skipped, 0 not run), check-queries 8/8 prepared,
config-check OK.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UGAZTzU6FGJSQKj437rr3L
conf/gr was in neither test map from the day Greece was added.
countryConfigPaths() drives TestRealConfigsValidate and
TestSharedFloorsAgreeAcrossCountries, so `go test ./...` never validated
Greece's config, and — the half that matters — never checked that
Greece's shared-layer floors agree with the other four countries'. There
is one zxy_map_<layer> reading one set of parent tables, so a country
that disagrees about where a shared layer stops decides it for everyone;
Greece has been adding partitions to shared tables for three issues
without that check running. It passes today, which is the point: it is
now asserted rather than assumed.

configdir_test.go's countryLayers is the other half and is deliberately
NOT in this commit. That map pins the layer set AND its order, so it can
only be written once the layer set stops moving — it would go red the
moment the sibling Greece PR merges. It belongs to whichever of the two
lands second, which then adds conf/gr with the full nine-layer list.

This commit is identical on both open Greece branches so the two merge
without a conflict here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UGAZTzU6FGJSQKj437rr3L
art-bot force-pushed issue-192-gr-water-bodies from 47a0c1afcf to bc9481c790 2026-08-20 19:17:17 +00:00 Compare
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!195
No description provided.