From d835a2afac6e062c5e08b3b65b8048d1dd55cd39 Mon Sep 17 00:00:00 2001 From: Johannes Roeder Date: Mon, 16 Nov 2020 11:21:32 +0100 Subject: [PATCH 1/8] Fix dist attribute name --- dhnx/input_output.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dhnx/input_output.py b/dhnx/input_output.py index d2177987..1214ec83 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) @@ -207,7 +207,7 @@ def download_footprints(self): print('Downloading footprints...') footprints = ox.footprints.footprints_from_point( - point=self.place, distance=self.distance + point=self.place, dist=self.distance ) footprints = footprints.drop(labels='nodes', axis=1) From 8b5f83fece7a6dd05d67ae665535c63b39bc0689 Mon Sep 17 00:00:00 2001 From: Johannes Roeder Date: Mon, 16 Nov 2020 11:22:48 +0100 Subject: [PATCH 2/8] Comment gdf names attribute --- dhnx/input_output.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dhnx/input_output.py b/dhnx/input_output.py index 1214ec83..9cd51bf5 100644 --- a/dhnx/input_output.py +++ b/dhnx/input_output.py @@ -268,7 +268,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.graph['name']) to_return.append(gdf_nodes) @@ -300,7 +300,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.graph['name']) to_return.append(gdf_edges) From 681435a30334d78a0febbe5ed17c247e3c47d54a Mon Sep 17 00:00:00 2001 From: Johannes Roeder Date: Mon, 16 Nov 2020 11:23:39 +0100 Subject: [PATCH 3/8] Comment gdf projection --- dhnx/input_output.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dhnx/input_output.py b/dhnx/input_output.py index 9cd51bf5..36b03267 100644 --- a/dhnx/input_output.py +++ b/dhnx/input_output.py @@ -401,7 +401,7 @@ def load(self): footprints = self.download_footprints() - footprints = ox.project_gdf(footprints) + # footprints = ox.project_gdf(footprints) component_dfs = self.process(graph, footprints) From 06269a0ad2766b7d863f0964aae5c6f6bc018aee Mon Sep 17 00:00:00 2001 From: Johannes Roeder Date: Thu, 19 Nov 2020 09:50:25 +0100 Subject: [PATCH 4/8] Fix deprecated osmnx func footprints_from_points by geometries_from_point --- dhnx/input_output.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dhnx/input_output.py b/dhnx/input_output.py index 36b03267..af033895 100644 --- a/dhnx/input_output.py +++ b/dhnx/input_output.py @@ -206,8 +206,10 @@ def download_footprints(self): print('Downloading footprints...') - footprints = ox.footprints.footprints_from_point( - point=self.place, dist=self.distance + footprints = ox.geometries_from_point( + center_point=self.place, + dist=self.distance, + tags={'building': True}, ) footprints = footprints.drop(labels='nodes', axis=1) From 228fc00ea1dca7e8e02c8e76ccb3c5095df815d8 Mon Sep 17 00:00:00 2001 From: Johannes Roeder Date: Thu, 19 Nov 2020 09:52:52 +0100 Subject: [PATCH 5/8] Remove dubplicated projection of footprints --- dhnx/input_output.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/dhnx/input_output.py b/dhnx/input_output.py index af033895..474bdd5a 100644 --- a/dhnx/input_output.py +++ b/dhnx/input_output.py @@ -403,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) From 9f1d488b90332deeeb7fe664e126cd6353d489a3 Mon Sep 17 00:00:00 2001 From: Johannes Roeder Date: Thu, 19 Nov 2020 13:30:25 +0100 Subject: [PATCH 6/8] Fix adding name of graph to gdf --- dhnx/input_output.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dhnx/input_output.py b/dhnx/input_output.py index 474bdd5a..f1e0304e 100644 --- a/dhnx/input_output.py +++ b/dhnx/input_output.py @@ -270,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) @@ -302,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) From 54e1e33c015b393c062fe8b02eb88ac7cb1baba2 Mon Sep 17 00:00:00 2001 From: Johannes Roeder Date: Thu, 19 Nov 2020 13:40:25 +0100 Subject: [PATCH 7/8] Add version requirement to osmnx extras_require --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'], } ) From 242de4cb571eaffb1f15389f9278fabcda241536 Mon Sep 17 00:00:00 2001 From: Johannes Roeder Date: Thu, 19 Nov 2020 13:43:52 +0100 Subject: [PATCH 8/8] Update whatsnew --- docs/whatsnew/v0-0-2.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/whatsnew/v0-0-2.rst b/docs/whatsnew/v0-0-2.rst index 673f215c..e230cb11 100644 --- a/docs/whatsnew/v0-0-2.rst +++ b/docs/whatsnew/v0-0-2.rst @@ -26,7 +26,7 @@ Documentation Bug fixes ^^^^^^^^^^^^^^^^^^^^ -* something +* Fix osmnx import to osmnx version 0.16 Known issues ^^^^^^^^^^^^^^^^^^^^ @@ -46,4 +46,4 @@ Other changes Contributors ^^^^^^^^^^^^^^^^^^^^ -* something +* Johannes Röder