Use platform nodes + route membership for bus stop clustering
Replaces distance-based clustering with route-membership grouping: - download_osm.py: collect route_refs per stop node; use platform roles for bus stops, stop roles for rail stops - prepare.py: carry route_refs through to master.gpkg - render.py: group_by_route_membership() uses union-find to cluster same-name stops sharing at least one route into one marker; stops on disjoint routes are kept separate. No distance threshold needed. Results: 786 bus platforms -> 465 markers (was 1610 -> 781). Veksøvej: 2 platforms sharing routes 2A+5C -> 1 marker. Peter Bangs Vej: 7 platforms on routes 10/21/22/4A/7A -> 2 markers.
This commit is contained in:
@@ -171,7 +171,7 @@ def main():
|
||||
if stops is not None and not stops.empty:
|
||||
stops = stops[~stops.geometry.isna() & stops.geometry.is_valid]
|
||||
stops_clipped = gpd.clip(stops, area_geom)
|
||||
keep = ["mode", "style", "name", "ref", "public_transport", "railway", "geometry"]
|
||||
keep = ["mode", "style", "name", "ref", "public_transport", "railway", "route_refs", "geometry"]
|
||||
for c in keep:
|
||||
if c not in stops_clipped.columns:
|
||||
stops_clipped[c] = None
|
||||
|
||||
Reference in New Issue
Block a user