Skip to content

Commit d2fa58d

Browse files
authored
Merge branch 'master' into develop
2 parents e73ff90 + 02f10fe commit d2fa58d

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

osmuf/core.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@ def gen_gross_city_blocks(street_graph, net_city_blocks=None):
288288
# reindex the columns
289289
gross_city_blocks = gross_city_blocks.reindex(columns=['city_block_id', 'place', 'geometry'])
290290
# 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
292295

293296
return gross_city_blocks
294297

@@ -353,7 +356,7 @@ def project_measure_gdf(gdf):
353356
GeoDataFrame
354357
"""
355358
# use osmnx to project gdf to UTM
356-
gdf_proj = ox.project_gdf(gdf)
359+
gdf_proj = ox.projection.project_gdf(gdf)
357360
# write perimeter length into column
358361
gdf_proj['perimeter_m'] = gdf_proj.length
359362
# write area into column
@@ -683,7 +686,7 @@ def join_places_building_data(places_proj, buildings_proj):
683686
building_areas_by_place=buildings_proj[['footprint_m2','total_GEA_m2']].groupby(buildings_proj['city_block_id']).sum()
684687
# if there are buildings not associated with a city_block they aggregate under 0
685688
# 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:
687690
building_areas_by_place = building_areas_by_place.drop([0])
688691

689692
places_proj = places_proj.merge(building_areas_by_place, on = 'city_block_id')

osmuf/plot.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@
2626
from descartes import PolygonPatch
2727

2828
from osmnx import settings
29-
# from osmnx import save_and_show
29+
from osmnx.plot import _save_and_show as save_and_show
3030
from osmnx.utils import log
31-
# from osmnx.utils import make_str
3231

3332
import matplotlib.pyplot as plt
3433
import matplotlib.cm as cm

osmuf/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def gdf_convex_hull(gdf):
8888

8989
# project gdf back to geographic coordinates as footprints_from_polygon
9090
# requires it
91-
gdf_temp = ox.project_gdf(gdf, to_latlong=True)
91+
gdf_temp = ox.projection.project_gdf(gdf, to_latlong=True)
9292
# determine the boundary polygon to fetch buildings within
9393
# buffer originally 0.000225, buffer actually needs to go whole block away
9494
# to get complete highways therefor trying 0.001

0 commit comments

Comments
 (0)