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 weight is 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 from single_source_dijkstra_path() or a path-matrix cell.

  • weight (Literal['length_meter', 'time_min']) – Edge weight used to choose between parallel edges.

Return type:

GeoDataFrame

Returns:

GeoDataFrame of traversed edges with path_order, path_u and path_v columns.