Skip to content

Instantly share code, notes, and snippets.

@shaystrong
Created May 8, 2019 04:48
Show Gist options
  • Save shaystrong/e025fd1f29e868d818da0402681b48b8 to your computer and use it in GitHub Desktop.
Save shaystrong/e025fd1f29e868d818da0402681b48b8 to your computer and use it in GitHub Desktop.
%matplotlib inline
import osmnx as ox
import matplotlib.pyplot as plt
place_name = "Nzwani Centre, Comores"
graph = ox.graph_from_place(place_name, which_result=2)
fig, ax = ox.plot_graph(graph)
area = ox.gdf_from_place(place_name)
buildings = ox.buildings_from_place(place_name)
nodes, edges = ox.graph_to_gdfs(graph)
fig, ax = plt.subplots()
area.plot(ax=ax, facecolor='black')
edges.plot(ax=ax, linewidth=1, edgecolor='#BC8F8F')
buildings.plot(ax=ax, facecolor='khaki', alpha=0.7)
plt.tight_layout()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment