python geo plotting using osmnx

Python Geo Plotting using OSMnx

To setup

  pip install rtree
  brew install spatialindex 
  pip install OSMnx
%matplotlib inline
import osmnx as ox
city = ox.gdf_from_place('Muscat, Oman')
ox.plot_shape(ox.project_gdf(city))

png

places = ox.gdf_from_places(['Oman','Iran'])
places = ox.project_gdf(places)
ox.save_gdf_shapefile(places)
ox.plot_shape(ox.project_gdf(places))

png

(<matplotlib.figure.Figure at 0x1047bc198>,
 <matplotlib.axes._subplots.AxesSubplot at 0x10fab42b0>)
G = ox.graph_from_point((23.58, 58.4), distance=1750, network_type='all')
ox.plot_graph(G)

png

(<matplotlib.figure.Figure at 0x11111cda0>,
 <matplotlib.axes._subplots.AxesSubplot at 0x11113d710>)
G = ox.graph_from_place('Manila, Philippines', network_type='all')
ox.plot_graph(G)

png

(<matplotlib.figure.Figure at 0x112219b70>,
 <matplotlib.axes._subplots.AxesSubplot at 0x1189e9320>)