metro entrance merge is non-transitive: a chain of three groups emits a mislabelled, misplaced station #69
Labels
No labels
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#69
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?
Follow-up from the #66 review (per-country transit stops). Latent, not currently firing — #66 merges as-is.
What
The
metro_mergedCTE inconf/plmap.yamlcollapses same-station entrance groups whose centroids sit within 250 m. Each group name independently picks the largest group within 250 m as its winner:That relation is not transitive, and the final
GROUP BY m.winassumes it is.The failure
Three entrance groups A (5 entrances), B (10), C (12), where A–B and B–C are both under 250 m but A–C is over:
win= B (largest within 250 m of A)win= Cwin= CGrouping by
winemits two stations:So a station gets the wrong name and the wrong position — worse than the duplicate the merge exists to prevent.
Current status: does not fire
Measured against the live
pl_oikm:The only merge is the one the code was written for:
Two groups, symmetric, no chain. Warsaw's 38 stations are correct today.
Why fix it anyway
The comment in
plmap.yamlpresents this as a general recipe:It is documented as reusable, so the next dataset to use it — a second Polish metro, or any other named-entrance source — inherits a bug that Warsaw's geometry happens not to expose. A three-station chain within 500 m is entirely ordinary for a city-centre interchange.
Suggested shape
Cluster the group centroids instead of doing pairwise nearest-largest, then take the modal name per cluster:
DBSCAN's transitive closure is exactly the semantics the comment describes ("join all same-named points that are near each other"), and it is the same primitive the tram and rail branches already use — one fewer bespoke pattern in the file. Worth re-checking Wileński still merges and the 38-station count holds after the change.