Isochrones¶
Overview¶
An isochrone is the area reachable from an origin within a travel-time or distance budget along a transport
network. ObjectNat builds isochrones on an iduedu.UrbanGraph prepared by IduEdu (walk, drive, public transport or intermodal graph).
objectnat.get_graph_isochrones() returns one polygon per origin; objectnat.get_stepped_graph_isochrones()
splits the reachable area into bands of width step.
Method¶
Every origin is snapped to its nearest graph node, or node ids are taken from
graph_node_columnororigin_nodes.A Dijkstra search runs outward from the origins along the edge direction, with edge weights
time_min(minutes, default) orlength_meter(metres), up toweight_value_cutoff. The searches of all origins run in one parallel call of IduEdu’s Numba routines.The reachable nodes are turned into a polygon according to
geometry_type. The residual budget of a node (cutoff minus its cost) is converted to a distance. Fortime_min, the conversion uses the median speed (length_meter / time_min) of edges between nodes reached from that origin (walk edges on walk and intermodal graphs). When these edges have usable speeds, unreached parts of the graph do not affect the conversion. The geometry is then built as follows:"radius"(default): union of buffers around the reachable nodes; the radius of a buffer is the residual distance of its node, but at mostoff_network_distance(150 m by default);"ways": reachable edges buffered byroad_buffer_sizemetres, limited by buffers of the full residual distance;"separate": buffers ofbuffer_factor× residual distance around the reachable nodes, merged into one polygon.
The result is clipped to
zonewhen it is given.
Why the radius is capped. A buffer by the whole residual distance assumes that a person can walk straight from
a node in any direction for the rest of the budget, across blocks, courtyards and water. At the origin this is the
whole budget, so a 10-minute walk isochrone becomes a disc of about 800 m whatever the street layout. The cap
follows the approach of trip planners such as OpenTripPlanner and Conveyal R5: the search runs along the network,
and only the last stretch from a street to a place, at most off_network_distance, is walked off the network. The
isochrone then follows the streets that are actually reachable and narrows where they end. off_network_distance=None
gives the uncapped buffers.
On walk and intermodal graphs only pedestrian edges (type == "walk") shape "ways", and only their end nodes
shape any geometry: transit route nodes take part in the search, but their cost includes the boarding wait, and
several route nodes can share one stop location.
Stepped isochrones assign every reachable node to the interval [0, step), [step, 2·step), … that contains its
cost, up to weight_value_cutoff (by default the cost of the farthest reachable node), and build one band per
interval:
geometry_type=None uses Voronoi cells around the nodes, "radius" and "ways" clip these cells to the
residual-radius buffers or to the buffered streets, and "separate" builds independent buffers per interval.
With several origins, the bands describe their combined reachability: each node keeps the cost from its nearest
origin. The column dist contains the upper bound of the interval.
Outputs¶
GeoDataFrames in the CRS of the input origins. objectnat.get_graph_isochrones() has one row per origin with
source_node and the input attributes; objectnat.get_stepped_graph_isochrones() has one row per band
and the column dist (minutes or metres).
- objectnat.get_graph_isochrones(urban_graph, *, weight_value_cutoff, gdf_origins=None, origin_nodes=None, graph_node_column='graph_node_id', weight_type='time_min', geometry_type='radius', zone=None, buffer_factor=0.7, road_buffer_size=5.0, off_network_distance=150.0, max_workers=None)[source]¶
Calculate accessibility isochrones from origin objects over an urban graph.
An isochrone is the area reachable from an origin within
weight_value_cutoff. Unlike coverage, each origin gets its own independent isochrone, but all shortest-path searches run in a single parallel Numba call. The function:Snaps each origin to its nearest graph node (or uses the provided
origin_nodes).Runs one Dijkstra search per origin in parallel.
Builds a reachability polygon for each origin with the selected
geometry_type.Optionally clips each isochrone to
zone.
- Parameters:
urban_graph (
UrbanGraph) – City graph with node and edge tables.weight_value_cutoff (
float) – Maximum travel time (minutes) or distance (metres) defining the isochrone extent.gdf_origins (
geopandas.GeoDataFrame, optional) – Origin objects. If the table containsgraph_node_columnthose ids are used; otherwise geometries are snapped to nearest nodes. Pass either this ororigin_nodes.origin_nodes (
Iterable, optional) – Ready-made origin node ids, used instead ofgdf_origins.graph_node_column (
str) – Name of the graph node id column ingdf_origins.weight_type (
Literal['time_min','length_meter']) –Type of edge weight used for path calculation:
"time_min": time-based accessibility in minutes"length_meter": distance-based accessibility in metres
geometry_type (
Literal['radius','ways','separate']) –Method used to build each isochrone:
"radius": union of buffers around the reachable nodes by their remaining budget as a distance, at mostoff_network_distance"ways": buffered reachable road geometry (walk edges only on intermodal/walk graphs)"separate": buffers ofbuffer_factor× residual distance around the reachable nodes, merged into one polygon
zone (
gpd.GeoDataFrame | gpd.GeoSeries, optional) – Boundary polygon to clip the resulting isochrones.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.max_workers (
int, optional) – Number of parallel Numba threads. Defaults to the Numba runtime.
- Returns:
One isochrone polygon per origin with a
source_nodecolumn andgeometry, returned in the CRS ofgdf_origins(or the graph CRS). The index matchesgdf_origins/origin_nodes.- Return type:
gpd.GeoDataFrame
Notes
For
geometry_type="ways"the search budget is slightly extended so road edges are not clipped short of the boundary.Origins with no reachable nodes are dropped from the result.
On walk and intermodal graphs the geometry is built from nodes reachable on foot; transit route nodes, whose distance includes the wait to board, only take part in the search.
- objectnat.get_stepped_graph_isochrones(urban_graph, *, gdf_origins=None, origin_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 accessibility isochrones from origin objects over an urban graph, splitting each reachable area into concentric bands of width
step.Unlike coverage, the search runs outward from the origins (along the original edge direction on a directed graph). The function:
Snaps each origin to its nearest graph node (or uses the provided
origin_nodes).Runs a multi-source Dijkstra search outward from the origins.
Buckets reachable 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_origins (
geopandas.GeoDataFrame, optional) – Origin objects. If the table containsgraph_node_columnthose ids are used; otherwise geometries are snapped to nearest nodes. Pass either this ororigin_nodes.origin_nodes (
Iterable, optional) – Ready-made origin node ids, used instead ofgdf_origins.graph_node_column (
str) – Name of the graph node id column ingdf_origins.weight_type (
Literal['time_min','length_meter']) –Type of edge weight used for path calculation:
"time_min": time-based accessibility in minutes"length_meter": distance-based accessibility 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 travel time or distance. IfNone, the isochrone is built out to the farthest reachable node.zone (
gpd.GeoDataFrame | gpd.GeoSeries, optional) – Boundary polygon to clip the resulting stepped isochrones.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 isochrone polygons with a
distcolumn (the upper bound of each step, in units ofweight_type) andgeometry, returned in the CRS ofgdf_origins(or the graph CRS).- Return type:
gpd.GeoDataFrame
Notes
Multiple origins are processed together: the bands describe the combined reachability of all origins (each node keeps the distance to its nearest origin).
On walk and intermodal graphs the bands are built from nodes reachable on foot, so a stop is drawn in the band it is walked to, not in the bands of the waits for the vehicles that call there.
An empty
GeoDataFrameis returned when nothing is reachable.
Figures¶
15-minute isochrone on the intermodal graph of Vasilyevsky Island with geometry_type="ways" and
"radius", and 8-minute "radius" isochrones of three origins (one polygon per origin). Background: pedestrian streets of the graph and the district boundary.¶
Stepped isochrones up to 15 minutes in bands of 3 minutes, geometry_type="ways", "radius" and
"separate"; dist is the upper bound of the band. Background: pedestrian streets of the graph and the district boundary.¶
Limitations¶
Travel times are those stored in the graph (
time_min); congestion, timetables beyond the waiting times modelled by IduEdu, and turn penalties are not considered.The polygon outside the network is an interpolation.
"radius"assumes straight-line movement for at mostoff_network_distancefrom the streets;"separate"assumes it for the whole residual budget and therefore overestimates reach across blocks without paths.Origins are snapped to the nearest graph node; the access distance from the origin to that node is not added.