Fix use of osmnx to work with v0.14

This commit is contained in:
Tom Russell 2020-06-18 10:31:34 +01:00
parent c997654545
commit 4eb5961af5

View File

@ -21,11 +21,13 @@ size = 256
# load buildings from about 1.5km² around UCL # load buildings from about 1.5km² around UCL
point = (51.524498, -0.133874) point = (51.524498, -0.133874)
dist = 612 dist = 612
gdf = osmnx.buildings_from_point(point=point, distance=dist) gdf = osmnx.footprints_from_point(point=point, dist=dist)
# preview image # preview image
gdf_proj = osmnx.project_gdf(gdf, to_crs={'init': 'epsg:3857'}) gdf_proj = osmnx.projection.project_gdf(gdf, to_crs={'init': 'epsg:3857'})
fig, ax = osmnx.plot_buildings(gdf_proj, bgcolor='#333333', color='w', figsize=(4,4), gdf_proj = gdf_proj[gdf_proj.geometry.apply(lambda g: g.geom_type != 'MultiPolygon')]
fig, ax = osmnx.plot_footprints(gdf_proj, bgcolor='#333333', color='w', figsize=(4,4),
save=True, show=False, close=True, save=True, show=False, close=True,
filename='test_buildings_preview', dpi=600) filename='test_buildings_preview', dpi=600)