iduedu.edge_stats

iduedu.edge_stats(urban_graph, by='type', *, area=None, precision=0.01)[source]

Edge counts, lengths and speeds for every value of an edge column.

Parameters:
  • urban_graph (UrbanGraph) – Graph in a projected (metric) CRS.

  • by (str) – Edge column to group by, for example "type", "category" or "highway". Edges without a value form the group "<missing>".

  • area (BaseGeometry | GeoSeries | GeoDataFrame | None) – Measure only edges and segments whose midpoint lies inside (see graph_stats()).

  • precision (float) – Grid for comparing segment end points, see unique_segments().

Return type:

DataFrame

Returns:

DataFrame indexed by the values of by, sorted by length, with columns edge_count, length_km (every physical segment once, counted for the group of the first edge that has it), length_share, edge_length_mean (metres) and speed_kmh (total length over total travel time, when edges have length_meter and time_min).

Raises: