OSMnx

2.1.0 · active · verified Mon Apr 13

OSMnx is a Python package that simplifies the process of downloading, modeling, analyzing, and visualizing street networks and other geospatial features directly from OpenStreetMap. It is built upon NetworkX and GeoPandas, providing a powerful toolkit for urban and spatial analysis. The current version is 2.1.0, and the library maintains an active development cycle with regular updates and major releases that may introduce breaking changes.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to download a drivable street network for a specified place and then visualize it. It also shows how to enable caching for API requests.

import osmnx as ox

# Configure osmnx to use a cache for API calls
ox.settings.use_cache = True

# Download and model a street network for a place
place = "Piedmont, California, USA"
G = ox.graph.graph_from_place(place, network_type="drive")

# Plot the graph
fig, ax = ox.plot_graph(G)

view raw JSON →