merge_lines: no way to drop an attribute below the zoom that renders it (roads.level costs +16% chains at z11) #167
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#167
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?
merge_linesgroups by every non-geometry attribute, which is what makes the groupingsafe (nothing a filter, a rollup or the style can see is blurred together) and also what
makes a sparse, frequently-changing attribute expensive: every place the value changes
along a road cuts a merged chain in two, and a chain is two more pinned endpoints at every
zoom below.
roads.level(#164, closing #18) is the first attribute where this is visible. Measured onthe z11 merge, against the live database:
levellevelThose extra chains buy nothing where they are paid. Grade separation is not legible below
about z13 — a bridge is metres long — while
merge_linesruns from z12 down(
merge_from_zoom: 12). The attribute is needed at z13/z14 and is dead weight everywherethe merge operates.
What is missing is a way to say "this attribute stops varying below zoom N": drop it
from the merge
GROUP BYand write NULL (or a declared floor value) into the cascade tablefrom that zoom down.
enum_rollupsis the nearest existing mechanism and does not fit — itis polygon-shaped (
ST_Union/ST_Dump, re-unioning same-class neighbours) and itreplaces the zoom's whole generalization step rather than modifying the merge.
Sketch: a per-layer/contract key alongside
merge_from_zoom, e.g.mergeLinesSQLalready builds its column list andGROUP BYfromattrnameslist(), so thechange is local: emit
NULL::<type> AS <attr>in the SELECT and leave the attribute out ofthe
GROUP BY. It needsvalidateMergeto reject an attribute named by azoom_filterswhereat or below that zoom (the filter would then be reading a NULL it did not expect),and a decision on whether the style's
roads_under_*/roads_over_*minzooms move up to13 to match — a layer that can never draw at its declared minzoom violates the
minzoom-mirroring invariant in
docs/style.md.Verification would be the same measurement above, plus tile-weight before/after at z11 and
z12, and a re-generalize of
roadsacross the four countries.Found in the review of !165. The cost is documented in
conf/common.yamlnext to thelevelattribute and indocs/generalization.mdundermerge_lines; nothing is broken,this is a generalization efficiency gap.