Bridge centrelines through water polygons that have none #40
Labels
No labels
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#40
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?
Split out of #36, which is where the measurements come from.
What
A watercourse surveyed as an area often has no centreline through it, so once the
polygon is generalized away there is nothing left to draw and the river ends in nothing.
Counted at maxz, river-class
water_bodiespolygons with nowaterwaysline intersectingthem:
This is what stops
min_width_pixelsbeing usable onwater_bodiesoutside Poland. #36added the knob and measured the orphaned area it leaves at the z9→z8 step — dropped
polygon area with no waterway within one pixel: Poland 30 km² of 1 713 (1.8%), Iceland 408
of 2 377 (17%), Sweden 1 896 of 4 433 (43%). Poland is the only country that could
turn it on, and the reason is entirely about network completeness, not about width.
Why it is probably cheap
The graph work already exists and already runs.
importer/strahler.gostitches exactlythis gap for stream ordering: endpoints that die into a water polygon are bridged through
it and the nodes collapse into a super-node. It costs 67 s for Sweden's 838 973
segments, on every
waterwaysimport, today. What it does not do is materialise abridge as geometry — the collapse is graph-level only.
So the proposal is to emit the bridge as linework: for each water polygon that has ≥2
stream endpoints on its boundary and no line through it, add a segment joining them
(straight line first;
ST_ApproximateMedialAxisfrom SFCGAL is the real answer and almostcertainly not needed, because the polygon is sub-pixel wide at every zoom where this
matters). The addition is on the order of thousands of two-point lines per country.
Answering the cost question from #36 directly: this is the ~1 minute end of the range, not
the ~10 hour end, because the hard part is already paid for.
Acceptance
are left alone (there is nothing to join).
order of magnitude, turn on
min_width_pixels: 1on theirwater_bodies— the configcomments in
conf/semap.yamlandconf/ismap.yamlname this measurement as the gate.exist" — the same rule #36 worked under.
Could we implement this with lines that have an extra attribute so that there's a temporary toggle in the rendering so that I can visually see the difference? Duplicate the layer in the style with some "debug-" name that only renders the lines with that particular attribute, while the original layer doesn't.
Then just make a second pull request to disable that extra attribute and clean up the style (the website mechanism to turn debug features on and off in the rendering should probably be generalized and stick around, it might be useful later).