Shared contours layer — fold is_haedarlinur in (#151) #198
No reviewers
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!198
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-151-shared-contours"
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?
Closes #151
Shared contours layer — fold is_haedarlinur in (se #101 / pl #104 / fi #107 land into it)
What changed
Made
contoursa shared layer (issue #151), folding Iceland's per-countryismap_contours_<z>tables into the partitionedmap_contours_<z>parent, exactlythe mechanism
airports/buildingsused. The style's three contour layers now readthe shared
mapsource instead ofis.conf/shared/contracts/18-contours.yaml(new) — thecontourscontract:stop_z: 10,maxz: 14,simplify_line, attrs[geom, elevation, interval_class]— Iceland's exact values, so the fold is a clean partition move. Carries the
cross-country acceptance tests (R119 no-empty-partition over the catalogue, R120
no-NULL/valid
elevation/interval_class).conf/is/07-contours.yaml— nowextends: contours; the scaffold (zoom range,strategy, attrs) is inherited from the contract. The
zoom_filterscascade — theper-source thinning — stays here, because it is the source cadence. The old R119/R120
moved to the contract; the one genuinely Iceland-specific claim (the coarse-zoom
500 m elevation ladder at z10) is a new R31 acceptance test here.
conf/world.yaml—contoursadded to themapsource's layer list, so theshared
zxy_mapfunction concatenates it (this is what regenerates the tile sourcethe style now points at).
html/style.yaml— the three layerscontours,contours_index,contour_labelsswitchsource: is→source: map.source-layer: contoursisunchanged (the shared layer keeps its name). The
issource block is left inplace —
peaksstill reads it; issue #152 removes it entirely once peaks goesshared too (noted in a comment).
schema.md,style.md,country-iceland.mdupdated to record contours as shared;peaksis now the onlyIceland-only layer.
Design decision — the attribute set
Kept
interval_class(rather than renaming to a binarycontour_index) as thecontract attribute. Reasoning, recorded in the contract comment:
The contract pins the one convention the whole map can agree on:
interval_class = 1is the index line for every source. The style's== 1filters and labelskey on that unchanged.
20 m, 5 = 10 m fine) — the z12 filter drops only the fine rung below z13. A binary
index/non-index flag would collapse that and silently over-thin or over-draw the
map.
convention: the index line is
1, the values above are each source's intermediates.Sweden #101 (5 m
hojdlinje,stodkurvahalf-interval) and Poland #104(
poziomica) map their index markers into1when they land; a country that neverdraws a fine rung simply never emits it. This is the airports
airport_classmodel — one shared ladder, each source maps into it.
Verification (live DB)
Reimported the layer (
importer/importer import --layer contours conf/is), thenmake import-worldto regeneratezxy_mapwith contours.map_contours_<z>_is): z14 139 690, z13 139 690, z12138 111 (drops the 10 m fine rung), z11 24 873 (index only), z10 4 064 (500 m
lines only) — matches the cascade and the old per-country counts exactly.
elevation/ 0 NULLinterval_classat every zoom.map_contours_10..14_ispresent.tiles --checkdecodeszxy_map_contoursat z10 and z14 withexactly the declared keys
[elevation interval_class country]; the sharedzxy_mapnow includes the contours blob.make acceptance(conf/is — the config this change touches)The three new tests (R31, R119, R120) fail if the data is wrong and passed here.
Full
make acceptanceacross all configs reports 47 passed / 1 failed / 1 not run;the single failure —
layer buildings (pl) / R120 ... context deadline exceeded— is apre-existing, unrelated slow Poland-buildings query: reproduced identically on
main (
ebdaa34) via a clean worktree, and touches nothing in this change.Left undone / notes
peaksstays Iceland-only and still served byzxy_is; issue #152 retires theissource entirely once peaks goes shared. Theissource block and the oldismap_contours_*tables remain (the latter are #12's orphan-cleanup work).when their data arrives; the contract comment records the mapping each will fill.
istile source, and the docs that still say it is there 285679c504The fold left `contours` in conf/is/downloads.yaml's `is` source layer list. A shared layer resolves to the one zxy_map_contours (importer/source.go layerFunc), so zxy_is would have concatenated a second, unread copy of contours into every Iceland tile — the style reads them from `map` now. Every earlier fold took the layer off this list for exactly that reason (cover, roads, settlements, airports, buildings); contours does too, and the comment records it with the rest. Verified on the live DB: zxy_is regenerated to `SELECT zxy_ismap_peaks(...)`, and at 12/1831/1079 over Iceland zxy_map is 3125 B of which zxy_map_contours is 1903, while zxy_is is down to 127 B of peaks. `tiles --check` decodes contours from zxy_map_contours at z10 and z14 with keys [elevation interval_class country]. `importer acceptance conf/is` is 40/40, including the three new tests (R31 z10 floor 4064 lines / not_500=0; contract R119 partitions=5; R120 countries=1). Docs and comments that named contours as Iceland-only: geo-primer's two-sources passage (the interleaving example was contours-on-`is`), unification.md's "is … holding contours and peaks", naming.md's per-country table example, mapsrv.yaml and shared/acceptance.yaml's layer lists, and the peaks R119 comment that pointed at contours for the pattern. Two typos in the new contract ("KEpt", "countour's"). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A2QYwuohkM9vWJs6uzsK58