File tree 3 files changed +8
-6
lines changed
3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -288,7 +288,10 @@ def gen_gross_city_blocks(street_graph, net_city_blocks=None):
288
288
# reindex the columns
289
289
gross_city_blocks = gross_city_blocks .reindex (columns = ['city_block_id' , 'place' , 'geometry' ])
290
290
# delete the index name
291
- # del gross_city_blocks.index.name
291
+ try :
292
+ del gross_city_blocks .index .name
293
+ except AttributeError :
294
+ pass
292
295
293
296
return gross_city_blocks
294
297
@@ -353,7 +356,7 @@ def project_measure_gdf(gdf):
353
356
GeoDataFrame
354
357
"""
355
358
# use osmnx to project gdf to UTM
356
- gdf_proj = ox .project_gdf (gdf )
359
+ gdf_proj = ox .projection . project_gdf (gdf )
357
360
# write perimeter length into column
358
361
gdf_proj ['perimeter_m' ] = gdf_proj .length
359
362
# write area into column
@@ -683,7 +686,7 @@ def join_places_building_data(places_proj, buildings_proj):
683
686
building_areas_by_place = buildings_proj [['footprint_m2' ,'total_GEA_m2' ]].groupby (buildings_proj ['city_block_id' ]).sum ()
684
687
# if there are buildings not associated with a city_block they aggregate under 0
685
688
# if this happens remove them from the dataframe
686
- if 0 in building_areas_by_place .index :#building_areas_by_place.index.contains(0):
689
+ if 0 in building_areas_by_place .index :
687
690
building_areas_by_place = building_areas_by_place .drop ([0 ])
688
691
689
692
places_proj = places_proj .merge (building_areas_by_place , on = 'city_block_id' )
Original file line number Diff line number Diff line change 26
26
from descartes import PolygonPatch
27
27
28
28
from osmnx import settings
29
- # from osmnx import save_and_show
29
+ from osmnx . plot import _save_and_show as save_and_show
30
30
from osmnx .utils import log
31
- # from osmnx.utils import make_str
32
31
33
32
import matplotlib .pyplot as plt
34
33
import matplotlib .cm as cm
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ def gdf_convex_hull(gdf):
88
88
89
89
# project gdf back to geographic coordinates as footprints_from_polygon
90
90
# requires it
91
- gdf_temp = ox .project_gdf (gdf , to_latlong = True )
91
+ gdf_temp = ox .projection . project_gdf (gdf , to_latlong = True )
92
92
# determine the boundary polygon to fetch buildings within
93
93
# buffer originally 0.000225, buffer actually needs to go whole block away
94
94
# to get complete highways therefor trying 0.001
You can’t perform that action at this time.
0 commit comments