Street network figure-ground diagrams, à la Allan Jacobs's Great Streets

Use OSMnx to download square-mile city street networks and visualize them as figure-ground diagrams. Discussed in this blog post.

In [1]:
import osmnx as ox
from IPython.display import Image
%matplotlib inline
ox.config(log_file=True, log_console=True, use_cache=True)
In [2]:
# configure the inline image display
img_folder = 'images'
extension = 'png'
size = 350
dpi = 90

Part I: create diagrams by passing in lat-long points

In [3]:
place = 'sf'
point = (37.793897, -122.402189)
fig, ax = ox.plot_figure_ground(point=point, filename=place, dpi=dpi)
Image('{}/{}.{}'.format(img_folder, place, extension), height=size, width=size)
Out[3]:
In [4]:
place = 'portland'
point = (45.517309, -122.682138)
fig, ax = ox.plot_figure_ground(point=point, filename=place, network_type='drive', dpi=dpi)
Image('{}/{}.{}'.format(img_folder, place, extension), height=size, width=size)
Out[4]:
In [5]:
place = 'irvine'
point = (33.694981, -117.841375)
fig, ax = ox.plot_figure_ground(point=point, filename=place, network_type='drive', default_width=6, dpi=dpi)
Image('{}/{}.{}'.format(img_folder, place, extension), height=size, width=size)
Out[5]:
In [6]:
place = 'rome'
point = (41.901336, 12.471831)
fig, ax = ox.plot_figure_ground(point=point, filename=place, network_type='all', default_width=3.3, dpi=dpi)
Image('{}/{}.{}'.format(img_folder, place, extension), height=size, width=size)
Out[6]:
In [7]:
place = 'barcelona-gothic'
point = (41.382850, 2.174192)
fig, ax = ox.plot_figure_ground(point=point, filename=place, network_type='all', default_width=3.3, dpi=dpi)
Image('{}/{}.{}'.format(img_folder, place, extension), height=size, width=size)
Out[7]: