diff --git a/dhnx/input_output.py b/dhnx/input_output.py index d2177987..f1e0304e 100644 --- a/dhnx/input_output.py +++ b/dhnx/input_output.py @@ -195,7 +195,7 @@ def download_street_network(self): print('Downloading street network...') graph = ox.graph_from_point( - center_point=self.place, distance=self.distance + center_point=self.place, dist=self.distance ) graph = ox.project_graph(graph) @@ -206,8 +206,10 @@ def download_footprints(self): print('Downloading footprints...') - footprints = ox.footprints.footprints_from_point( - point=self.place, distance=self.distance + footprints = ox.geometries_from_point( + center_point=self.place, + dist=self.distance, + tags={'building': True}, ) footprints = footprints.drop(labels='nodes', axis=1) @@ -268,7 +270,7 @@ def graph_to_gdfs(G, nodes=True, edges=True, node_geometry=True, fill_edge_geome axis=1) gdf_nodes.set_geometry('geometry', inplace=True) gdf_nodes.crs = G.graph['crs'] - gdf_nodes.gdf_name = '{}_nodes'.format(G.graph['name']) + gdf_nodes.gdf_name = '{}_nodes'.format(G.name) to_return.append(gdf_nodes) @@ -300,7 +302,7 @@ def graph_to_gdfs(G, nodes=True, edges=True, node_geometry=True, fill_edge_geome # create a GeoDataFrame from the list of edges and set the CRS gdf_edges = gpd.GeoDataFrame(edges) gdf_edges.crs = G.graph['crs'] - gdf_edges.gdf_name = '{}_edges'.format(G.graph['name']) + gdf_edges.gdf_name = '{}_edges'.format(G.name) to_return.append(gdf_edges) @@ -401,8 +403,6 @@ def load(self): footprints = self.download_footprints() - footprints = ox.project_gdf(footprints) - component_dfs = self.process(graph, footprints) self.add_component_data_to_network(component_dfs) diff --git a/setup.py b/setup.py index 4d3d3323..39cb7b4f 100644 --- a/setup.py +++ b/setup.py @@ -36,6 +36,6 @@ def read(fname): extras_require={ 'cartopy': ['cartopy'], 'geopandas': ['geopandas'], - 'osmnx': ['osmnx'], + 'osmnx': ['osmnx >= 0.16.1'], } )