Networks & routing
Street networks as graphs: shortest paths, travel time, isochrones and snapping.
A street network is a graph: nodes where streets meet, edges between them, and a cost on every edge. Once your data is in that shape, shortest path, travel time, isochrones and service areas are all the same algorithm with different stopping rules.
Getting into that shape is where the errors are. Every point that is not already a node has to be attached to one, and a snap of a few tens of metres onto the wrong side of a dual carriageway or the wrong end of a one-way street turns into hundreds of metres of route. The graph does not know it happened, and neither does the result — which is why so much of this topic is about the join between your points and the network rather than about routing itself.
The concepts cover graphs, impedance and what an isochrone really represents; the how-to guides build, snap and route; and the fixes are the distances that come back absurd and the reasons they do.
🧭 Start with the concepts
The ideas the how-to guides below assume you already have.
- Street Networks as Graphs Explained
- Network Distance vs Straight-Line Distance Explained
- Isochrones Explained: Travel Time Areas and What They Assume
- Location Analysis Explained: Catchments, Accessibility and Site Selection
- Catchment Areas Explained: Buffers, Isochrones and Voronoi Compared
- Accessibility Measures Explained: Nearest, Cumulative and Gravity
Show every concept in this topic
- Location-Allocation Explained: p-Median, Coverage and What Each Optimises
- Stream Order Explained: Strahler, Shreve and What They Measure
- Linear Referencing Explained: Routes, Measures and Events
- Street Network Orientation Explained
- Urban Blocks Explained
- Internet Latency Explained: Milliseconds, Distance and Loaded Latency
⚙️ Then do the task
Step-by-step walkthroughs with code you can copy and adapt.
- How to Build a Street Network Graph in Python with OSMnx
- How to Snap Points to a Street Network in Python
- How to Calculate the Shortest Path Along a Street Network
- How to Measure Network Distance for Many Origin-Destination Pairs
- How to Generate Isochrones in Python
- How to Map-Match a GPS Track to a Street Network
Show every how-to guide in this topic
- How to Measure Distance to the Nearest Facility for Every Home
- How to Measure Access to Services with the Two-Step Floating Catchment Method
- How to Choose Facility Locations with a p-Median Model in Python
- How to Maximise Coverage with a Limited Number of Sites
- How to Find the Areas Nobody Can Reach Within a Travel Time
- How to Calculate Strahler Stream Order in Python
- How to build walking catchments around transit stops
- How to compute transit travel times from GTFS in Python
- How to draw a transit isochrone from a GTFS feed
- How to find the measure of a point on a route
- How to find the point at a given measure on a route
- How to build measures onto a line that has none
- How to Measure Street Orientation Entropy in Python
- How to Extract Urban Blocks from a Street Network in Python
- How to Calculate Street Network Metrics in Python
- How to Measure Deforestation Near Roads in Python
- How to Count Crime on Street Segments in Python
- How to Build a High-Injury Network from Crash Data in Python
- How to Get Roads by Type From OpenStreetMap in Python
- How to Get Railway Lines and Stations From OpenStreetMap in Python
- How to Map Cycle Lanes From OpenStreetMap in Python
- How to Build an Airline Route Network and Draw Great-Circle Routes in Python
🔧 When it breaks
The errors this topic produces, with the cause explained rather than just the command.
- OSMnx Download Fails, Hangs or Times Out
- NetworkX Says No Path Exists Between Two Nodes
- Street Network Routing Returns Absurd Distances
- Fixing Accessibility Scores That Are Wrong Near the Study Area Edge
- Transit travel times come out too short
- A point snaps to the wrong carriageway
Show every fix in this topic
Learning paths through this topic
A curated route rather than a list — the guides in the order that builds on itself.
Related topics
Subjects that keep coming up alongside this one, most overlap first.