Closes #101 #202
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!202
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-101-se-contours-peaks"
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 #101
Sweden contours + peaks from Topo 10 Höjd (issue #101)
What changed
Sweden's
contoursandpeaksfrom Lantmäteriet Topo 10, tema Höjd, landing intothe shared
contours/peakscontracts (issues #151/#152) as thesepartitions ofmap_contours_<z>/map_peaks_<z>, side by side with Iceland's. The layersextends:the contracts, so the zoom range, attribute set and strategy are inherited; the
zoom_filterscascade — the per-source cadence — stays in the se config, exactly as thecontracts intend.
conf/se/downloads.yaml— the Höjd theme via a newtopo10-hojdgeotorget order(a separate entry for the same reason as
topo10-text/topo10-byggnadsverk: arotating delivery id must not force a re-download of the whole topo10 order). Plus the
se_hojd_t10databases:entry. R5, recorded on first fetch:hojd_sverige.zipis2 506 916 311 bytes zipped / 9 134 403 584 bytes on disk.
conf/se/staging.yaml— two staged feature layers, streamed like the buildingstheme:
se_hojdlinje_t10(5 576 429 lines, Höjdkurva5 2401 + Gropkurva5 2402 depressioncontours, 5 m ekvidistans) and
se_hojdpunkt_t10(33 783 spot heights).conf/se/16-contours.yaml— the se contours partition.conf/se/17-peaks.yaml— the se peaks partition.importer/configdir_test.go,importer/geotorget_test.go— layer-set / geotorget-orderexpectations updated for the two new layers and the fifth order.
docs/—country-sweden.mdrecords the R5 sizes and that contours/peaks are nolonger Iceland-only;
country-requirements.mdinventory flips thesecolumn to ✅ forboth.
The interval ladder and the dense-end cascade
The contract pins
interval_class = 1as the index/major line. Lantmäteriet marksexactly that with
stodkurva='Ja'(every fifth line, 25 m) — so stodkurva → 1, theremaining 5 m lines → rung 2. The source carries no finer sub-ladder, so Sweden's ladder
is
{1, 2}(the contract allows a country with no finer rung to never emit one).Sweden is the dense end: 5.58M lines, ~40× Iceland's 139k, so the cascade thins
harder and earlier. The "serve z12+ for the fine lines" guess from the issue is answered
by measurement — the fine 5 m rung is z14-only (5.58M lines cannot be served at z13
without swamping a tile), the 25 m index at z13 (1.1M), the 100 m index at z12 (239k),
and a 500 m floor at z11/z10 (27k) — the same coarse floor Iceland uses.
Peaks are elevation markers (no
name, per contract), thinning z13 ≥200 m, z11 ≥500 m(1 987 high summits at the coarse floor) — the same 500 m coarse floor as Iceland.
Verification (live DB)
Row counts per zoom — match the design:
(The small z13/z12 drops from 1 097 264/239 551 are simplify_line's length floor — 15 and
5 sub-pixel contour segments.)
NULLs that matter = 0 (
elevation/interval_class); every contour is a 1/2 rung;both
_isand_separtitions coexist at every zoom in the shared parents (10 partitionscontours, 8 peaks). Decoded tiles over the Swedish mountains: z13 contours (14 features),
z14 contours (366 features, 46.8 kB — the price of 5 m detail on a mountain tile), z11
peaks (11 features); the tiles carry
elevation+interval_class+countryproperties,the keys the style's index stroke and labels read.
Acceptance tally (
make acceptanceover the se config — all contours/peaks tests):Notes for the reviewer
contours/peakscontracts live on unmerged branches(PRs #198/#199). This branch is based on main with those two commits cherry-picked on
top (their docs/schema/style conflicts resolved to the post-both state), then the se
work on top. Merge #198/#199 first; the cherry-picked commits then drop out on rebase.
make acceptancefailure (not mine): a PolandbuildingsR120 test(
sum(ST_NumGeometries)over PL's ~9M footprints) times out at 10s. Reproduces inisolation on conf/pl, untouched by this change. Flagging rather than silently hiding.
conf/is/downloads.yamlstill listslayers: [contours]on theissource — aleftover from #151/#152 landing in parallel (contours is now shared, so
zxy_isservingit is redundant with
zxy_map). Left out of this se-focused PR; worth a one-line cleanuponce #198/#199 merge.
becomes possible once Finland's contours land (#107).
not changed; tune the fine rung if tile weight matters.
fa01f58b37to5af667beccThe import itself verifies: 5 576 429 staged contour lines land as 5 576 429 rows in map_contours_14_se (ST_Dump adds no parts), 1 097 264 of them interval_class 1 against 1 097 264 stodkurva='Ja', thinning 1 097 249 / 239 546 / 26 948 / 26 948 down the cascade; peaks 33 783 / 13 403 / 13 403 / 1 987 with elevations 1–1797. Every number in the PR body reproduced exactly. Four changes on top: - The Sweden contours R120 was `timeout: 10` and took 7.7 s in a `make acceptance` run — and 9.1 s in `make acceptance-all`, which would have failed the cap on a slightly busier box. Both halves are seq scans over 5.58M rows (0.8 s + 2.4 s warm); no index answers either predicate and adding one for a test is not worth it. Moved to `timeout: 100`, which per importer/acceptance.go runsIn also moves it out of the default run into `make acceptance-all` — a deliberate trade, and the right home: the claim it pins is the stodkurva→interval_class source mapping, which changes when the Höjd theme is re-fetched, not when the layer is rebuilt. The contract's own R120 (positive interval_class, 2.2 s) still runs every time. Same tier as the other million-row checks in conf/pl/15-buildings, conf/se/03-cover and conf/world. - se_hojdpunkt_t10.hojdvarde loads as bigint, and the peaks query passed it through uncast to the contract's int column, relying on the assignment cast. Harmless at 1–1797 m, but the contours query next door casts explicitly; made peaks match and recorded the gpkg-vs-Postgres type in staging.yaml. - 16-contours.yaml and 17-peaks.yaml had no trailing newline; 17-peaks said 33 787 spot heights in one line of a comment that says 33 783 everywhere else. Docs: this is the first country other than Iceland to draw either layer, so the claims that terrain is Iceland-only needed retiring, not just the Sweden catalogue's own entry — country-iceland.md ("no other country has terrain data yet", written when #152 merged an hour ago), geo-primer's draw-order preamble and its per-country zoom table (which had no `peaks` row at all), country-sweden's section heading, and R13's non-conformance row 11, which gets a **Resolved** note in the style rows 6 and 10 already use: nothing on that line is Iceland-only now, and what remains is Poland (#104) and Finland (#107/#108) owing partitions. Verified: acceptance conf/se 53/53 in the default tier and 54/54 under -acceptance all; both shared contracts now report two countries (contours partitions=10, peaks=8); tiles --check decodes both from zxy_map_* with the declared keys; make test and gl-style-validate pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A2QYwuohkM9vWJs6uzsK58