Last active
December 6, 2023 15:46
-
-
Save secemp9/f94cfc1ea682bb3891c59b6b0c921cb6 to your computer and use it in GitHub Desktop.
Pulling map data with osmnx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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