OSMnx: New methods for acquiring, constructing, analyzing, and visualizing complex street networks
Geoff Boeing
Introduces OSMnx, a Python package that automates the extraction, topological correction, and multi-scale spatial analysis of complex street networks directly from OpenStreetMap data.
Urban planning and transportation research frequently face major methodological bottlenecks when analyzing street networks. Existing empirical studies often rely on small sample sizes of 10 to 50 networks due to the high friction of data collection, oversimplify real-world systems into flat two-dimensional graphs that misrepresent infrastructure such as bridges and tunnels, and suffer from poor replicability caused by ad hoc definitions. These constraints limit the ability of decision-makers and planners to evaluate network performance, resilience, and connectivity consistently at scale.
The article introduces and evaluates OSMnx, a free, open-source Python software package designed to automate the collection, topological correction, visualization, and spatial analysis of complex street networks anywhere in the world using OpenStreetMap data.
OSMnx enables researchers to construct topologically accurate, non-planar directed graphs natively with minimal code. To establish and demonstrate this capability, the article outlines the tool's core architecture—combining network analysis, geographic information systems, and elevation data—and applies it to a comparative case study across three 0.5-square-kilometer neighborhood sections in Portland, Oregon: Downtown, Laurelhurst, and Northwest Heights.
The analysis demonstrates several key findings regarding urban form, connectivity, and network vulnerability. In terms of density and scale, Downtown exhibits a fine-grained, dense layout with 164 intersections per square kilometer and an average segment length of 76 meters, compared to Northwest Heights' coarse-grained layout of 28 intersections per square kilometer and an average segment length of 117 meters. Topological analysis revealed that Downtown's network initially appeared less resilient to disruption, requiring only 1.3 node failures on average to disconnect paths between random locations, compared to 2.1 in Laurelhurst; this reduced resilience stems entirely from Downtown's strict one-way street network. When modeled as two-way streets, Downtown's resilience more than doubled to 2.9 paths, making it the most robust of the three. Additionally, betweenness centrality analysis revealed significant bottleneck risks: in Northwest Heights, a single critical intersection handles 43% of all shortest paths, whereas Downtown’s most central node handles only 15%, indicating high vulnerability to single-point disruptions in suburban-style layouts.
These findings have direct operational and policy implications for urban design and infrastructure management. Street directionality heavily penalizes network redundancy, showing that converting one-way corridors to two-way configurations can substantially improve traffic resilience and circulation options. Furthermore, measuring network centrality highlights critical choke points, allowing city agencies to prioritize specific intersections for safety enhancements, disaster mitigation, and maintenance before disruptions occur.
Transportation planners and researchers should leverage automated spatial tools to conduct large-scale, reproducible network evaluations rather than relying on manual, small-sample approaches. When evaluating circulation systems, analysts should account for true directionality and non-planar structures to avoid distorted metrics. Future work should expand analyses beyond isolated neighborhood subsets to prevent boundary edge effects and incorporate richer streetscape attributes as crowdsourced databases expand.
Confidence in the tool’s spatial and topological accuracy is high, though readers should note that the analysis depends on the completeness of OpenStreetMap data, which is extensive across the United States and Europe but less detailed in parts of the developing world. Additionally, the illustrative case study reflects small sample boundaries that omit surrounding regional traffic flows, meaning broader municipal conclusions should rely on large-scale network datasets.
- Paper: Spatial Networks, Marc Barthelemy (2010). Provides the foundational theoretical principles of spatial constraints, planarity, and centrality anomalies in geographically embedded networks like street networks.
- Paper: Spatio-temporal Graph Convolutional Neural Network: A Deep Learning Framework for Traffic Forecasting, Bing Yu et al. (2017). Applies deep graph convolutional modeling to predict dynamic traffic flows over spatial road network topologies like those constructed and exported by OSMnx.
- Paper: Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting, Yaguang Li et al. (2017). Extends spatial network analytics by modeling traffic dynamics as a diffusion process over directed sensor road graphs.
- Paper: T-GCN: A Temporal Graph Convolutional Network for Traffic Prediction, Ling Zhao et al. (2018). Leverages road network topology and recurrent units to forecast temporal traffic conditions on urban street layouts.
- Paper: Graph WaveNet for Deep Spatial-Temporal Graph Modeling, Zonghan Wu et al. (2019). Advances deep spatio-temporal modeling on road networks by learning adaptive spatial dependencies alongside fixed network connectivity.
- Paper: Attention Based Spatial-Temporal Graph Convolutional Networks for Traffic Flow Forecasting, Shengnan Guo et al. (2019). Introduces spatial-temporal attention mechanisms on graph-structured road topologies to forecast multi-scale traffic flows.
- Paper: Spatial-Temporal Synchronous Graph Convolutional Networks: A New Framework for Spatial-Temporal Network Data Forecasting, Chao Song et al. (2020). Develops synchronous spatial-temporal graph convolutions for forecasting localized traffic patterns over real-world road networks.
- Paper: Adaptive Graph Convolutional Recurrent Network for Traffic Forecasting, Lei Bai et al. (2020). Enhances traffic prediction on urban road networks by adaptively learning node-specific parameters and hidden spatial relations.
- Paper: Attention, Learn to Solve Routing Problems!, Wouter Kool et al. (2018). Applies attention-driven reinforcement learning to solve vehicle routing and traveling salesperson problems across spatial networks.
- Paper: Learning Combinatorial Optimization Algorithms over Graphs, Elias Boutros Khalil et al. (2017). Combines graph neural network representations and reinforcement learning to automate combinatorial optimization heuristics on network graphs.
- Paper: Road Extraction by Deep Residual U-Net, Zhengxin Zhang et al. (2017). Presents a deep learning approach for extracting road networks and spatial geometry from remote sensing imagery.
