Closes #71 #72
No reviewers
Labels
No labels
blocked
claude-wip
map-report
map:is
map:se
needs-review
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
art/ismap!72
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-71-place-label-budget"
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 #71
Place names importance ladder: budget labels by on-ground size
What and why
Finland served 308 importance-3 place names at z5 — the whole large-font tier of the
paikannimi register — and MapLibre's collision handling let Helsinki get crowded out.
The three-tier importance ladder (1–3) was too coarse to thin further: even the largest
register font size (570) covers 45 names. This change gives the places layer a
continuous per-country rank and cuts the cascade on it, with the per-zoom caps derived
from a design estimate of how much of the country a label covers.
The measurement
A place-name label's on-ground size is estimated, not measured at generalization time:
step(14 px at importance 3), text-max-width 8, text-padding 4, an 8-characteraverage name, 0.55 em glyph advance (Go Bold), 1.2 line height;
pixelSize(z) = 40075016.68 / (2^z × 256)m, so thelabel's on-ground area is
1726 × pixelSize(z)²;N(z) = X × area / (1726 × pixelSize(z)²)labels, floored at 1.The design constant and the reasoning live in the
placescontract comment(
conf/common.yaml); each country'szoom_filtersturn it intorank <= N(z).The ladder
rankisROW_NUMBER() OVER (ORDER BY importance DESC, <the survey's own finer signal> DESC, name), computed per country in the source query:kirjasinkoko(label-font size 330–570) — the survey printsHelsinki (rank 4) bigger than a village, and that distinction is exactly what the
1–3 collapse threw away;
örnefnaflokkurkennicode (land before sea/water/ice), then name.rankis mvt_exclude'd — it is cascade machinery, not map data; the style still readsimportancefor text-size andsymbol-sort-key. The contract gained the column andboth country partitions now carry it.
The budget
Default X = 60%. Per-zoom caps (Finland / Iceland land areas):
z13+ keeps the whole register (the budget exceeds the total there). At z5 Finland now
shows 4 names (FORSSA, HANKO, HEINOLA, HELSINKI — the survey's own order); Helsinki is
rank 4, so it is always included once a zoom has budget.
Options to try (edit the country
zoom_filters, the formula is in the contractcomment):
Verification (live DB)
-layer placesfor both countries; parent tables gained therankcolumn via an additive
ALTER TABLE(the contract'sensureParentSQLonly creates,it does not migrate).
1/4/17/70/282/1129/4519/18076/72305,is
1/1/5/23/95/382/1529/6121/24474— Iceland's z10+ shows one extra row per zoombecause 34 MultiPoint features (e.g. Biskupavörður) are ST_Dump'd into two rows that
share a pre-dump rank; pre-existing behaviour, ~0.07% overage.
every zoom z4–14.
[name, importance, country]—rankcorrectly excluded from the tile.place_namesincludingHELSINKI; Iceland z5 renders Ísland. Higher zooms render the expected denser ladders
(z11 shows importance-2 village names).
Notes
make build,go test ./...,go vet ./...pass in importer/ and mapsrv/.signal — e.g. among the 45 font-570 towns. A population join would be the real fix
and is future Workstream A material, not this issue's scope.
land-area figure; the mechanism is the estimate, so the cap is what matters.
art referenced this pull request2026-08-08 22:08:56 +00:00