diff --git a/etl/get_test_polygons.py b/etl/get_test_polygons.py index 6247a838..6b1b34e3 100644 --- a/etl/get_test_polygons.py +++ b/etl/get_test_polygons.py @@ -21,11 +21,13 @@ size = 256 # load buildings from about 1.5kmĀ² around UCL point = (51.524498, -0.133874) dist = 612 -gdf = osmnx.buildings_from_point(point=point, distance=dist) +gdf = osmnx.footprints_from_point(point=point, dist=dist) # preview image -gdf_proj = osmnx.project_gdf(gdf, to_crs={'init': 'epsg:3857'}) -fig, ax = osmnx.plot_buildings(gdf_proj, bgcolor='#333333', color='w', figsize=(4,4), +gdf_proj = osmnx.projection.project_gdf(gdf, to_crs={'init': 'epsg:3857'}) +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, filename='test_buildings_preview', dpi=600)