Skip to content

Instantly share code, notes, and snippets.

@ldodds
Created October 12, 2017 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ldodds/cffbc4bf4a4c639e01b50dd1ab6cde4c to your computer and use it in GitHub Desktop.
Save ldodds/cffbc4bf4a4c639e01b50dd1ab6cde4c to your computer and use it in GitHub Desktop.
B&NES Square Km maps
import osmnx as ox
ox.config(log_file=True, log_console=True, use_cache=True)
# configure the inline image display
img_folder = 'images'
extension = 'png'
size = 350
dpi = 120
street_widths = {'footway' : 0.5,
'steps' : 0.5,
'pedestrian' : 0.5,
'path' : 0.5,
'track' : 0.5,
'service' : 2,
'residential' : 3,
'primary' : 5,
'motorway' : 6}
points = {
#pin from google maps
'bath': (51.3801748,-2.373371),
#centre of high street
'keynsham' : (51.415514, -2.498433),
#a367, near junction
'radstock' : (51.292957, -2.447753),
#centre of high street
'midsomer_norton' : (51.287177, -2.479940),
'circus' : (51.385952, -2.364035),
'abbey' : (51.3833242,-2.3619697),
'whiteway' : (51.373627, -2.400658),
'oldfield_park' : (51.378175, -2.380069),
'widcombe' : (51.3712803,-2.358923,2732),
#outside bear pub
'bear_flat' : (51.373771, -2.366465),
#centre of walcot st
'walcot': (51.3860485,-2.3618686),
'batheaston' : (51.4092141,-2.3227916),
'bathampton' : (51.3953532,-2.3350424),
'claverton_down' : (51.3710953,-2.3345741),
'combe_down' : (51.3599248,-2.35112),
'odd_down' : (51.3584893,-2.382304),
'larkhall' : (51.3996807,-2.3496965),
'weston' : (51.3952093,-2.4048051)
}
for place, point in points.items():
print place
fig, ax = ox.plot_figure_ground(point=point, filename=place, network_type='all', street_widths=street_widths, dpi=dpi, fig_length=30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment