OSMnx

From OpenStreetMap Wiki
Jump to navigation Jump to search

OSMnx is a Python package to "Retrieve, model, analyze, and visualize street networks and other spatial data from OpenStreetMap."

The OpenStreetMap-Data are retrieved with Overpass and stored in a Geopandas Dataframe.

Code Example

Download street network data of the Area of San Francisco and build a topologically-corrected street network:

import osmnx as ox
bbox = -122.43, 37.78, -122.41, 37.79
G = ox.graph.graph_from_bbox(bbox, network_type="drive_service")

Download all Buildings from the city of Basel:

import osmnx as ox
buildings = ox.features_from_place("Basel, Switzerland", tags = {'building': True})

Documentation

The documentation is available from: https://osmnx.readthedocs.io

Find examples: https://github.com/gboeing/osmnx-examples

github.com/gboeing/osmnx - Github repo gives the overview description, instructions, and downloads

Created by Geoff Boeing. See his blog post overview and academic publication about OSMnx.

Example renderings from OSMnx

Urban form analysis produced using OSMnx. See more
Road/Street/Drive/way names in London. See more