Skip to content

Instantly share code, notes, and snippets.

@secemp9
Last active December 6, 2023 15:46
Show Gist options
  • Save secemp9/f94cfc1ea682bb3891c59b6b0c921cb6 to your computer and use it in GitHub Desktop.
Save secemp9/f94cfc1ea682bb3891c59b6b0c921cb6 to your computer and use it in GitHub Desktop.
Pulling map data with osmnx
import osmnx as ox
location = "Manhattan, New York City, New York, USA"
# Mode can be 'drive', 'bike', 'walk', etc.
G = ox.graph_from_place(location, network_type='drive')
nodes, edges = ox.graph_to_gdfs(G)
print(nodes.head())
print(edges.head())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment