iduedu.GraphEdits

class iduedu.GraphEdits(add=None, remove=None, update=None)[source]

Edits of a graph given by lines in any CRS, resolved by resolve_graph_edits().

Parameters:
  • add (GeoDataFrame | None) – Lines of new edges. Columns other than geometry become edge attributes, except: time_min and length_meter (computed when absent), speed_kmh (gives time_min when it is absent) and oneway (bool, default False: the edge can be travelled both ways).

  • remove (GeoDataFrame | None) – Anchor lines; the network along each of them is removed. An optional direction column ("both", the default, or "along") limits a directed graph to the direction the anchor is drawn in.

  • update (GeoDataFrame | None) – Anchor lines with the new values of the edges along them, in any columns except u, v and k. A missing value keeps the old one. speed_kmh sets time_min (and speed_mpm when the graph has it) from the edge length unless time_min is given. direction works as in remove.

Raises:
  • TypeError – If a table is not a GeoDataFrame.

  • ValueError – If a table has no CRS, a duplicated index, geometries other than non-empty LineStrings, reserved columns, or an unknown direction.