iduedu.UrbanGraphChanges

class iduedu.UrbanGraphChanges(edges_gdf=None, nodes_gdf=None, edges_to_delete=None, edges_to_update=None, is_multigraph=False, is_directed=False)[source]

Set of table changes that can be applied to an UrbanGraph.

The class is used as an intermediate result when projecting objects onto a graph or resolving geometric edits. It stores new nodes, new edges, edge keys that should be removed from the source graph and new attribute values of kept edges.

Parameters:
  • edges_gdf (GeoDataFrame | None) – New graph edges.

  • nodes_gdf (GeoDataFrame | None) – New graph nodes.

  • edges_to_delete (DataFrame | None) – Edge-key table for edges that should be removed.

  • edges_to_update (DataFrame | None) – Edge keys with new attribute values: one row per edge, the key columns and any other columns except geometry. A missing value (NaN) keeps the old value of the edge; a column absent from the graph is added.

  • is_multigraph (bool) – Must match UrbanGraph.is_multigraph.

  • is_directed (bool) – Whether edge keys should be interpreted as directed u -> v keys.

Raises:
  • TypeError – If change tables use unsupported types.

  • ValueError – If change keys or geometries are invalid.