Created
February 11, 2017 15:23
-
-
Save ldodds/02840a124bd3f85b2766a5a888d7b734 to your computer and use it in GitHub Desktop.
Generating 1sq km images of road network in and around B&NES
This file contains 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 | |
ox.config(log_file=True, log_console=True, use_cache=True) | |
# configure the inline image display | |
img_folder = 'images' | |
extension = 'png' | |
size = 350 | |
dpi = 90 | |
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment