style: let road, rail and transit widths keep growing past z14 #31
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!31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "night/issue-2-road-widths"
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 #2
Issue #2 — streets/roads style improvements
Branch:
night/issue-2-road-widths(one commit,ee36b16, not pushed, not merged)Files:
html/style.json,CLAUDE.mdWhat was actually wrong
Not the widths at z15 as such — the ramps. Every
line-widthramp in the style ended atz14, and
interpolateclamps above its last stop. So from z14 upwards a road was pinned toa fixed number of screen pixels while the world doubled under it every zoom. At z15 a
street was already thinner than its own label; at z16 a
minorstreet was a 2.0 px bandunder a 10.5 px label, which is exactly the "too thin" the issue describes. The same
defect was in
railways_*,transit_*andwaterways— all clamped at z14.Hornsgatan is
road_class = tertiaryin the Stockholm data (4.1 km of it; some shortstretches are
minor), and its side streets — Brännkyrkagatan, Krukmakargatan,Timmermansgatan, Bastugatan — are
minor. So the issue's acceptance test reads: tertiarymust hold a road name at z15, minor at z16.
What I changed
Road, rail and transit ramps now run to z17.
Roads grow ~2× per zoom above z13 — i.e. a constant width on the ground, which is what
"the street stays a street as you zoom" means. Fills at z15 / z16:
The two bold numbers are the issue's test:
tertiaryat z15 andminorat z16 are the same14.4 px. That is one class step per zoom, so
minoris exactly half oftertiaryat everyzoom.
Above
tertiarythe ladder is deliberately compressed rather than continuing to scale.The big classes are exaggerated at small scale so they stay visible at z5–z13; carrying that
exaggeration into a doubling ramp made the E20 interchange at Roslagstull a single orange
mass at z15 with the ramps merged into the carriageways. I rendered both and picked the
narrower one. Up there the class is carried by colour anyway.
Rail and transit are extended at ~1.4× per zoom instead of 2× — a track is drawn as a
line, not at its width on the ground — but they had to move: left clamped they became threads
beside the new roads. Casings keep a ring that widens from ~0.8 px at z14 to ~1.8–2.8 px at
z17.
Everything at z13 and below is untouched. Each ramp keeps its old stops and gains an
explicit z13 stop pinned to the value the old ramp interpolated there.
How I verified it
Sub-z14 curves unchanged: evaluated both versions of every ramp over z5–z13 in 0.1
steps. Max deviation 0.0033 px, from rounding the pinned z13 values to two decimals.
Rendered and measured, Chrome over CDP in real time (no
--virtual-time-budget),against the live
mapsrvon :8080, at z12–z17 over Södermalm, Roslagstull, Göteborg anda rural view near Finspång. Measurement: switch the label halo off (it is the same white as
the road fill and contaminates any pixel measurement), rotate the crop until the street runs
horizontal, then compare the white fill's row span with the label ink's.
gl-style-validate html/style.json— clean.Class hierarchy monotone (minor < tertiary < … < motorway) and every casing wider than its
fill, checked at z13–z17.
make buildandcd mapsrv && go test ./...— pass (no Go was touched).No import is needed: this is style only, and it needs no reimport or regeneralize.
Left undone / uncertain
waterwayshas the same clamp at z14 and I did not touch it, because its width is asteponimportancenested inside the interpolate stops, and because a wide river at highzoom is drawn by the
water_bodiespolygon rather than the centreline — so how much thecentreline should grow is a separate judgement, not a mechanical extension. A river is now
visibly thinner than the streets around it at z16. Worth its own issue if it bothers you.
(
road_names/station_labelstext size,station_dotsradius — screen-sized things), butbuildings_dots,buildings_iconsandpeaksicon-size also clamp at z13/z14 and arearguably the same bug on the Iceland layers. Not looked at.
numbers get silly (motorway would be 144 px at z18) — but if you routinely zoom to 18–19,
say so and the ramps can be extended.
tertiaryat14.4 px feels fat on a rural tertiary (it is ~35 m of ground there), the fix is to lower
the whole ladder and shrink
road_namestext-size to match — they move together.country-specific, but Poland's class mix differs and its
serviceshare is large.