iduedu.path_to_edges¶
- iduedu.path_to_edges(urban_graph, path, *, weight='time_min')[source]¶
Convert an ordered node path to ordered graph edges.
For parallel edges the first edge with the minimum selected
weightis used, matching the default adjacency-matrix aggregation rule. Edge attributes are preserved and reverse traversals receive reversed geometry.- Parameters:
urban_graph (
UrbanGraph) – Spatial urban graph containing edge geometries.path (
Iterable[Any]) – Ordered graph node ids, for example fromsingle_source_dijkstra_path()or a path-matrix cell.weight (
Literal['length_meter','time_min']) – Edge weight used to choose between parallel edges.
- Return type:
- Returns:
GeoDataFrame of traversed edges with
path_order,path_uandpath_vcolumns.