strahler: node-less bridging polygons are dropped from the adjacency, breaking pass-through chains #70
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#70
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 the #67 review. #67 fixes the type half of the polygon-adjacency predicate (
ST_Dimension >= 1); this is the other half, kept separate because it is a much larger graph change and needs a verified import per country.What
_ww_padjinimporter/strahler.gostitches adjacent bridging polygons, but only when both carry a stream node:The comment justifies it as "a polygon with none cannot be a super-node, so stitching it is meaningless." That is the right test for a polygon at the end of a chain and the wrong one for a polygon in the middle.
In A — B — C where B carries no stream node, the rule drops both A—B and B—C, so the chain breaks and A's drainage never reaches C. Including B would work:
computeStrahlerOrdersmaterializesP<pid>super-nodes from the padj adjacency itself, not only fromsuperOf, so a node-less polygon becomes a valid pass-through link. It cannot originate drainage — nothing roots there — but it conducts.This is the same failure mode #62 was filed for: a chain of touching river polygons that roots nowhere.
Measurements
Adjacent polygon pairs, replicated against the live
map_water_bodies_14/map_waterways_14(endpoint-within-30 m as the "used" test, matching the defaultbridge_meters; the old-rule column lands within 3% of the numbers #67 reported, which is the check that the replication is faithful):ST_Dimension(#67)Iceland breakdown of the 657 linear adjacencies by which side carries a node:
The
f/fpairs matter too: in A(used) — B — C — D(used) with B and C both node-less, all three links are needed.Connectivity effect on Iceland — union-find over the two edge sets, counting only polygons that carry a node:
37 more polygons join a chain and the longest chain grows from 34 to 37.
Why it is filed rather than folded into #67
Lifting the filter grows the adjacency by half again on Iceland and nearly triples it on Finland. That is a structural change to the drainage graph of every country that runs the stage, on top of the order-5 shifts #67 already produces (FI 479 → 3 673 by #67's own replication). It wants a real import and a rendered check per country, not a model.
Done when
pid IN (SELECT pid FROM _ww_node …)clauses are gone from_ww_padj.-layer waterways) against real source data, with the per-order histogram, NULL count and per-zoom cascade recorded, and a rendered check at a chain that previously rooted nowhere.docs/schema.md's "Adjacent water polygons" bullet drops the pointer to this issue.Result is in #96 — #96; the review note is the PR description.
Closed by measurement: the both-used filter stays lifted-off. PR #96's review asked which explanation the order collapse supports; reconstructing the real graph and computing orders under both padj variants shows the collapse is a spanning-tree re-ordering artifact, not "chains stitch":
The real blocker is
computeStrahlerOrders' BFS-spanning-tree reduction on dense cyclic lake networks (chords collapse, diameter-rooting is arbitrary). The pass-through fix is only safe once ordering is cycle-aware. PR #96 was reverted with this note.