Coverage Zones¶
Overview¶
A coverage zone is the area served by one service (a destination) within a travel-time or distance budget, where each place is assigned to the service that is closest along the network. Coverage differs from an isochrone in two respects: the network search runs towards the services (on the reversed graph), and zones of different services do not overlap.
objectnat.get_graph_coverage()builds one zone per service on aniduedu.UrbanGraph;objectnat.get_stepped_graph_coverage()splits the covered area into bands of widthstep;objectnat.get_radius_coverage()is a graph-free variant: a Voronoi partition of the services limited by a fixed radius.
Method¶
Every service is snapped to its nearest graph node, or node ids are taken from
graph_node_columnordestination_nodes.A multi-source Dijkstra search runs on the reversed graph from all services at once, so every node is labelled with the service it reaches at the lowest cost (
time_minin minutes orlength_meterin metres) withinweight_value_cutoff.Voronoi cells are built around the graph nodes, and the cells of the nodes labelled with one service are dissolved into its zone.
The zones are clipped to
zone(for example, a city boundary) or, without it, to the concave hull of the reachable nodes.geometry_type="radius"additionally clips them to buffers around the reachable nodes by the residual distance, at mostoff_network_distance(150 m by default, as for isochrones), andgeometry_type="ways"to the buffered streets. Fortime_minthe residual time is converted to a distance with the median speed (length_meter / time_min) of edges between reached nodes (walk edges on walk and intermodal graphs). When these edges have usable speeds, unreached parts of the graph do not affect the conversion.
On walk and intermodal graphs only pedestrian (type == "walk") edges shape "ways", and only their end nodes
shape any geometry, as for isochrones.
Stepped coverage labels every node with the cost to its nearest service and builds one band per cost interval of
width step: Voronoi cells (geometry_type=None), cells clipped to residual-radius buffers or streets
("radius", "ways") or independent buffers ("separate").
objectnat.get_radius_coverage() reprojects the services to a local UTM zone, builds their Voronoi polygons,
clips them to the union of radius-metre buffers around the services and smooths every polygon by an inward
buffer followed by a slightly smaller outward buffer, both proportional to the cube root of the polygon area. The
smoothing rounds the corners, so zones can be slightly smaller than the clipped Voronoi cells.
Outputs¶
objectnat.get_graph_coverage() and objectnat.get_radius_coverage() return one polygon per service,
indexed like the input services (join service attributes back by index).
objectnat.get_stepped_graph_coverage() returns polygons with the column dist (upper bound of the interval,
in minutes or metres). All results are in the CRS of the input services.
- objectnat.get_graph_coverage(urban_graph, *, gdf_destinations=None, destination_nodes=None, graph_node_column='graph_node_id', weight_type='time_min', geometry_type=None, weight_value_cutoff=None, zone=None, buffer_factor=0.7, road_buffer_size=5.0, off_network_distance=150.0)[source]¶
Calculate coverage zones of destinations (services) on an urban graph using Dijkstra reachability and Voronoi partitioning.
Coverage answers “which area is served by each destination”. The function:
Snaps each destination to its nearest graph node (or uses the provided
destination_nodes).Runs a multi-source Dijkstra search on the reversed graph, so every reachable node is labelled with its nearest destination within
weight_value_cutoff.Builds Voronoi polygons around the graph nodes.
Dissolves the reachable Voronoi cells per destination into one zone each.
Clips the result to
zone, to a residual-radius / road geometry (geometry_type), or to the concave hull of the reachable nodes.
- Parameters:
urban_graph (
UrbanGraph) – City graph with node (nodes_gdf) and edge (edges_gdf) tables.gdf_destinations (
geopandas.GeoDataFrame, optional) – Destinations the coverage is measured to. If the table already containsgraph_node_columnthose node ids are used directly; otherwise each geometry is snapped to its nearest graph node. Pass either this ordestination_nodes.destination_nodes (
Iterable, optional) – Node ids of the destinations, used instead ofgdf_destinations.graph_node_column (
str) – Name of the column with graph node ids ingdf_destinations.weight_type (
Literal['time_min','length_meter']) –Type of edge weight used for path calculation:
"time_min": edge travel time in minutes"length_meter": edge length in metres
geometry_type (
Optional[Literal['radius','ways']]) –Optional refinement of the coverage shape:
None: raw Voronoi cells clipped tozoneor the concave hull"radius": additionally clip to buffers around the reachable nodes (remaining budget as a distance, at mostoff_network_distance)"ways": additionally clip to buffered road geometry inside the residual radii (walk edges only on intermodal/walk graphs)
Requires
weight_value_cutoffwhen set.weight_value_cutoff (
float, optional) – Maximum path cost, e.g. max travel time or distance. Units depend onweight_type.zone (
gpd.GeoDataFrame | gpd.GeoSeries, optional) – Boundary polygon to clip the resulting zones. IfNoneand nogeometry_typeis given, the concave hull of the reachable nodes is used.buffer_factor (
float) – Not used by coverage zones; accepted for symmetry withget_stepped_graph_coverage()(default 0.7).road_buffer_size (
float) – Buffer applied to graph edges forgeometry_type="ways", in metres (default 5.0).off_network_distance (
float | None, optional) – Forgeometry_type="radius": how far from the network, in metres, a place may lie and still count as reached. Every reachable node is buffered by its remaining budget converted to a distance, but by no more than this, so the area follows the network instead of growing into a straight-line circle around the start.Nonebuffers by the whole remaining budget. Defaults to 150.
- Returns:
One coverage polygon per destination, returned in the CRS of
gdf_destinations(or the graph CRS when node ids are passed). The index matchesgdf_destinations/destination_nodes.- Return type:
gpd.GeoDataFrame
Notes
For a directed graph the search runs on the reversed edges, so a zone describes the area from which its destination can be reached.
On walk and intermodal graphs the zones are built from nodes reachable on foot, so route nodes sharing a stop cannot give one place to several destinations.
An empty
GeoDataFrameis returned when nothing is reachable.
- objectnat.get_stepped_graph_coverage(urban_graph, *, gdf_destinations=None, destination_nodes=None, graph_node_column='graph_node_id', weight_type='time_min', geometry_type='radius', weight_value_cutoff=None, zone=None, step=None, buffer_factor=0.7, road_buffer_size=5.0, off_network_distance=150.0)[source]¶
Calculate stepped coverage zones of destinations (services), combining graph reachability with banded (stepped) isochrone geometry.
Like
get_graph_coverage(), but instead of one zone per destination the reachable area is split into concentric bands of widthstep. The function:Snaps each destination to its nearest graph node (or uses the provided
destination_nodes).Runs a multi-source Dijkstra search on the reversed graph, labelling every reachable node with the cost to its nearest destination.
Buckets the nodes into steps and builds banded geometry with the selected
geometry_type.Optionally clips the bands to
zone.
- Parameters:
urban_graph (
UrbanGraph) – City graph with node and edge tables.gdf_destinations (
geopandas.GeoDataFrame, optional) – Destinations the coverage is measured to. If the table containsgraph_node_columnthose ids are used; otherwise geometries are snapped to nearest nodes. Pass either this ordestination_nodes.destination_nodes (
Iterable, optional) – Node ids of the destinations, used instead ofgdf_destinations.graph_node_column (
str) – Name of the graph node id column ingdf_destinations.weight_type (
Literal['time_min','length_meter']) –Type of edge weight used for path calculation:
"time_min": edge travel time in minutes"length_meter": edge length in metres
geometry_type (
Optional[Literal['radius','ways','separate']]) –Method used to build each step’s geometry:
None: Voronoi cells around graph nodes"radius": Voronoi cells clipped to the radius buffers (seeoff_network_distance)"ways": Voronoi cells clipped to buffered road geometry (walk edges only on intermodal/walk graphs)"separate": independent circular buffers per step
weight_value_cutoff (
float, optional) – Maximum path cost limiting the coverage extent. IfNone, the farthest reachable node defines the extent.zone (
gpd.GeoDataFrame | gpd.GeoSeries, optional) – Boundary polygon to clip the resulting stepped zones.step (
float, optional) – Width of each step, in units ofweight_type. Defaults to 100 metres forlength_meterand 1 minute fortime_min.buffer_factor (
float) – Buffer multiplier used bygeometry_type="separate"(default 0.7).road_buffer_size (
float) – Edge buffer forgeometry_type="ways", in metres (default 5.0).off_network_distance (
float | None, optional) – Forgeometry_type="radius": how far from the network, in metres, a place may lie and still count as reached. Every reachable node is buffered by its remaining budget converted to a distance, but by no more than this, so the area follows the network instead of growing into a straight-line circle around the start.Nonebuffers by the whole remaining budget. Defaults to 150.
- Returns:
Stepped coverage polygons with a
distcolumn (the upper bound of each step, in units ofweight_type) andgeometry, returned in the CRS ofgdf_destinations(or the graph CRS).- Return type:
gpd.GeoDataFrame
Notes
For a directed graph the search runs on the reversed edges; for an undirected graph on the original symmetric adjacency.
On walk and intermodal graphs the bands are built from nodes reachable on foot, so transit route nodes at a stop, whose cost includes the wait, do not move it to a later band.
An empty
GeoDataFrameis returned when nothing is reachable.
- objectnat.get_radius_coverage(gdf_from, radius, resolution=32)[source]¶
Calculate radius-based coverage zones using Voronoi polygons.
This is a graph-free coverage: zones are built purely from the service points, a fixed radius and a Voronoi partition, with no network involved.
- Parameters:
gdf_from (
geopandas.GeoDataFrame) – Service points for which coverage zones are calculated.radius (
float) – Maximum coverage radius in metres.resolution (
int) – Number of segments per quarter circle of the buffers (default 32).
- Returns:
Smoothed coverage zones, one polygon per point, in the CRS of
gdf_from.- Return type:
gpd.GeoDataFrame
Notes
The calculation runs in a local UTM zone, so
radiusis in metres.The zones are smoothed by a slight inward and outward buffer, which rounds their corners.
Figures¶
Coverage zones of the example services: within 10 minutes on the intermodal graph clipped to the district,
within 600 m of network distance, and the graph-free objectnat.get_radius_coverage() with radius=800.
Background: pedestrian streets of the graph and the district boundary.¶
Stepped coverage zones up to 15 minutes in bands of 2 minutes: geometry_type=None (Voronoi cells of the
graph nodes, clipped to the district with zone) and "separate" (independent buffers). "radius" and
"ways" clip the same Voronoi bands to the radius buffers or to the buffered streets. Background: pedestrian
streets of the graph and the district boundary.¶
Limitations¶
Each place is assigned to one service, the one with the lowest network cost; capacity is not considered. Use Service Provision to allocate demand under capacity limits.
Zone outlines between network nodes come from Voronoi cells and residual-distance buffers, not from the street layout; their accuracy depends on the density of graph nodes.
objectnat.get_radius_coverage()ignores the network and barriers such as rivers or railways.