iduedu.get_intermodal_graph¶
- iduedu.get_intermodal_graph(*, osm_id=None, territory=None, clip_by_territory=False, osm_edge_tags=None, max_dist=30, keep_largest_subgraph=True, add_link_edge=True, walk_kwargs=None, pt_kwargs=None)[source]¶
Build an intermodal (PT+walking)
UrbanGraphfor a territory.The function resolves a boundary polygon (by
osm_idorterritory), runs pedestrian graph construction (get_walk_graph()) and public transport graph construction (get_public_transport_graph()) in parallel, then connects public-transport platforms to nearby walk edges viajoin_pt_walk_graph()using themax_distsnapping radius. Edge lengths (meters) and travel times (minutes) come from the underlying builders and from the walk-edge splits created during projection.- Parameters:
osm_id (
int | None) – OSM relation/area id for the territory; provide this orterritory.territory (
Polygon | MultiPolygon | gpd.GeoDataFrame | None) – Boundary geometry in EPSG:4326.clip_by_territory (
bool) – If True, both PT and Walk graphs are clipped to the boundary.osm_edge_tags (
list[str] | None) – Subset of OSM tags to retain (forwarded to both builders).max_dist (
float) – Max distance in meters to connect PT platforms to walk edges.keep_largest_subgraph (
bool) – If True, keep only the largest strongly connected component after joining.add_link_edge (
bool) – If True, add platform-to-walk connector edges during projection.walk_kwargs (
dict[str,Any] | None) – Extra keyword args forget_walk_graph()(e.g.,walk_speed,simplify,osm_edge_tags,keep_largest_subgraph). Walk graph keep_largest_subgraph defaults to False unless explicitly set here.pt_kwargs (
dict[str,Any] | None) – Extra keyword args forget_public_transport_graph()(e.g.,transport_types,osm_edge_tags,transport_registry).
- Return type:
- Returns:
Intermodal
UrbanGraphcombining public transport and pedestrian edges. The graph CRS equals the builders’ local projected CRS.
Notes
clip_by_territoryandosm_edge_tagsare propagated to both builders unless overridden inwalk_kwargs/pt_kwargs.If the PT graph is empty for the area, the function returns the walking graph alone (with a warning).
Joining requires both sub-graphs to share the same CRS; builders derive a local projected CRS from the boundary’s extent, so lengths/times are in meters/minutes.