iduedu.apply_urban_graph_changes¶
- iduedu.apply_urban_graph_changes(graph_gdf, changes)[source]¶
Apply prepared changes to an
UrbanGraph.The function removes edges listed in
changes.edges_to_delete, appends new nodes and edges, and returns a new graph. Any previously cached adjacency matrix is considered stale after applying structural changes; rebuild it before running routing or accessibility calculations.- Parameters:
graph_gdf (
UrbanGraph) – Source graph.changes (
UrbanGraphChanges) – Changes prepared byproject_objects2urban_graph()or created manually.
- Return type:
- Returns:
New
UrbanGraphwith changes applied.- Raises:
ValueError – If graph and change topology flags differ or if
edges_to_deletereferences edges that are absent from the graph.