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, sets the values ofchanges.edges_to_update, appends new nodes and edges, and returns a new graph. The new graph has no cached adjacency matrix; routing builds it on the first query.- 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, if
edges_to_deleteoredges_to_updatereference edges that are absent from the graph, or if an edge is both deleted and updated.