Source-linked AI summary
OSMnx: New Methods for Acquiring, Constructing, Analyzing, and Visualizing Complex Street Networks
Geoff Boeing
TL;DR
Street-network research is constrained by data availability, consistency, and methodological reproducibility. The paper presents OSMnx to automate network acquisition, construction, correction, storage, and analysis, then demonstrates these capabilities in Portland, Oregon. The case study shows that the tool supports rapid metric and topological analysis and visualization of networks that differ in density, connectedness, centrality, and resilience.
Problem
Street-network research faces limited data availability and consistency, small samples, excessive simplification, and difficult reproducibility, restricting scalability and interpretability.
Method
OSMnx automates geographic and OpenStreetMap data acquisition, multidigraph construction, topology correction, file storage, routing, visualization, and metric and topological analysis.
Results
The Portland case study used OSMnx to rapidly acquire, analyze, and visualize networks differing substantially in density, connectedness, centrality, and resilience.
Takeaways & Limitations
OSMnx provides a simple, open-source way to make street-network collection, construction, and analysis easy, consistent, scalable, and automatable.
Takeaways & Limitations
OSMnx depends on OpenStreetMap data, which cannot describe streetscape or pedestrian-environment quality and has less thorough coverage in developing countries.
Abstract
from arXiv · showhide
Urban scholars have studied street networks in various ways, but there are data availability and consistency limitations to the current urban planning/street network analysis literature. To address these challenges, this article presents OSMnx, a new tool to make the collection of data and creation and analysis of street networks simple, consistent, automatable and sound from the perspectives of graph theory, transportation, and urban design. OSMnx contributes five significant capabilities for researchers and practitioners: first, the automated downloading of political boundaries and building footprints; second, the tailored and automated downloading and constructing of street network data from OpenStreetMap; third, the algorithmic correction of network topology; fourth, the ability to save street networks to disk as shapefiles, GraphML, or SVG files; and fifth, the ability to analyze street networks, including calculating routes, projecting and visualizing networks, and calculating metric and topological measures. These measures include those common in urban design and transportation studies, as well as advanced measures of the structure and topology of the network. Finally, this article presents a simple case study using OSMnx to construct and analyze street networks in Portland, Oregon.
1. Introduction
Street-network research spans urban form, transportation, and topology, but data and technology limitations make studies difficult to scale, reproduce, and interpret. OSMnx addresses these challenges with automated data acquisition, network construction, topology correction, storage, and analysis capabilities.
- Street-network studies examine urban form, transportation, and network topology, complexity, and resilience.
- Existing research faces small samples, excessive network simplification, difficult reproducibility, and a lack of consistent, easy-to-use tools.
- OSMnx automates downloading boundaries, building footprints, elevations, and customizable OpenStreetMap street networks.
- OSMnx corrects and simplifies topology, supports multiple storage formats, and provides routing, visualization, projection, and network-measurement functions.
- The article introduces the background and research challenges, presents OSMnx, and demonstrates it through a Portland, Oregon, case study.
2. Background
The paper frames street networks as spatial graphs whose representations and data sources shape analysis. It argues that limited data, simplification, inconsistent methodological decisions, and inadequate tools constrain reproducible and scalable research.
- 2.1. Graphs and networks: Graph theory represents elements as nodes and connections as edges, while networks apply these abstractions to real-world systems.
- 2.1. Graphs and networks: Street networks may be directed, connected, weighted, planar or non-planar, and represented with self-loops or parallel edges.
- 2.2. Representation of street networks: Primal graphs represent intersections as nodes and street segments as edges, preserving geographic and metric information that dual graphs discard.
- 2.4. Current tool landscape: Street-network data sources and preprocessing can limit research: TIGER/Line and other datasets create acquisition, consistency, and conversion challenges.
- 2.5. Research problem: Unreported choices about spatial extents, topology, directedness, nodes, and edges make studies difficult to reproduce and complicate interpretation and generalizability.
- 2.4. Current tool landscape: Available tools divide capabilities between GIS functionality and graph analysis, leaving no ideal balance of usability, customizability, reproducibility, and scalability.
3. OSMnx: Functionality and comparison to existing tools
OSMnx is a Python package that automates worldwide acquisition, construction, correction, visualization, storage, and analysis of complex street networks. It supports flexible geographic and network queries while preserving relevant topology and spatial data.
- 3.2. Download and construct street networks: OSMnx downloads boundary geometries, building footprints, elevations, and customized street networks from OpenStreetMap for places worldwide.It supports individual geographic entities, lists of places, and locations where street-network data may otherwise be inconsistent or difficult to acquire.
- 3.2. Download and construct street networks: OSMnx accepts bounding boxes, points, addresses, polygons, place names, or lists of place names as network queries.Users can also choose network types such as drive, walk, bike, all, and private-access variants.
- 3.2. Download and construct street networks: OSMnx constructs primal, non-planar, weighted multidigraphs that preserve one-way directionality, self-loops, and parallel edges.Its acquisition workflow geocodes place names, buffers their boundaries, downloads OpenStreetMap data, and constructs directed edges for one-way and bidirectional streets.
- 3.3. Correct and simplify network topology: OSMnx automatically corrects and simplifies inconsistent OpenStreetMap topology while preserving street-segment geometry and attributes.Strict and non-strict modes define which dead-ends, self-loops, junctions, and one-way transitions remain as graph-theoretic nodes.
- 3.4. Save street networks to disk: OSMnx projects, plots, saves, and loads networks in formats including GraphML, shapefiles, and SVG.Shapefile export preserves one-way directionality and origin/destination nodes as attributes, while SVG supports design work.
- 3.5. Analyze street networks: OSMnx supports automated network analysis, including spatial and topological statistics, shortest paths, impedance weighting, and visualization.Routes can account for one-way streets and be weighted by distance, travel time, or elevation change.
4. Case study: Portland, Oregon
OSMnx constructs and analyzes comparable street-network subsets in three Portland neighborhoods, revealing substantial differences in density, topology, connectivity, centrality, and resilience.
- Network construction: OSMnx downloads, projects, and plots drivable directed networks for three 0.5 km2 Portland study areas while preserving legitimate peripheral intersections.The sites are Downtown, Laurelhurst, and Northwest Heights; bounding boxes do not conform to complete neighborhood boundaries.
- Metric measures: Downtown has 164 intersections/km2 and 21 linear km of street/km2, compared with 110 and 16 in Laurelhurst and 28 and 5 in Northwest Heights.Average street-segment lengths are 76 m, 92 m, and 117 m, respectively, indicating progressively coarser grain.
- Topological measures: Average streets emanating from each node are 3.9 in Downtown, 3.6 in Laurelhurst, and 2.4 in Northwest Heights.Northwest Heights has mostly 3-way intersections and dead-ends, with one-third of its nodes being dead-ends.
- Connectivity and resilience: Average node connectivity is 1.3 in Downtown, 2.1 in Laurelhurst, and 1.4 in Northwest Heights, despite Downtown’s greater density.For undirected networks, the values are 2.9, 2.5, and 1.4; Downtown’s value would more than double under that representation.
- Centrality and disruption: Average betweenness centrality is 7% in Downtown, 8% in Laurelhurst, and 14% in Northwest Heights.The most important Northwest Heights node carries 43% of shortest paths, versus 15% for the most important Downtown node.
- Centrality and disruption: Northwest Heights is more prone to disruption after failure of its most important node than Downtown is after failure of its most important node.The comparison reflects the concentration of shortest paths through Northwest Heights’ critical chokepoints.
5. Discussion
The discussion presents OSMnx as a free, open-source tool for scalable, reproducible street-network analysis and illustrates its use with Portland networks. The authors also note that OSMnx depends on OpenStreetMap coverage and does not measure streetscape or pedestrian-environment quality.
- Contributions: OSMnx addresses usability, planarity, reproducibility, and sample-size challenges by acquiring, constructing, correcting, storing, visualizing, and analyzing street networks.It enables analysis of hundreds or thousands of networks and uses nonplanar directed graphs.
- Case study: The Portland case study shows that OSMnx can nearly instantaneously acquire, analyze, and visualize networks in two or three lines of code.The quantitative analysis corresponded with visual assessment and found differences in density, connectedness, centrality, and resilience.
- Scope boundaries: The Portland case study is limited by its small sample size and peripheral edge effects because each subset ignores flows outside the subset.A subsequent project used OSMnx to analyze 27,000 street networks at multiple scales across the United States.
- Limitations: OSMnx cannot assess streetscape or pedestrian-environment quality and depends on the attributes and coverage available in OpenStreetMap.Coverage is described as very good in the United States and Europe but less thorough in developing countries.
Appendix: Code and Data
The appendix demonstrates OSMnx workflows for downloading, constructing, correcting, projecting, plotting, and measuring networks, along with building-footprint retrieval. It also points to a public repository of 27,000 U.S. street networks and their measures.
- Code examples: OSMnx workflows can download, construct, correct, project, and plot street networks.The examples include downloading and plotting a projected Los Angeles driving network and obtaining a walkable Modena network.
- Code examples: Users can obtain networks from place boundaries, geocoded addresses, shapefiles, or latitude-longitude points.Address-based retrieval supplies a network within a specified distance when polygon boundaries are unavailable.
- Code examples: After downloading a network, users can calculate its measures.
- Code examples: OSMnx can also download building footprints wherever data is available.
- Data repository: A public repository shares shapefiles, GraphML files, and measures for 27,000 U.S. street networks across metropolitan, municipal, and neighborhood scales.The collection covers every U.S. city and town, census urbanized area, and Zillow-defined neighborhood.