How to download and constrtuct a graph in osmnx?
up vote
1
down vote
favorite
I try the following code:
G = ox.graph_from_place('Greater London, UK', network_type='walk')
But it keeps giving the following error:
ConnectionError: HTTPSConnectionPool(host='nominatim.openstreetmap.org', port=443): Max retries exceeded with url: /search?format=json&limit=1&dedupe=0&polygon_geojson=1&q=Greater+London%2C+UK (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f50301d5470>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
Anyone knows anything about this bug?
Also is there a way to construct a Graph in osmnx from edges & nodes?
From the Following code:
G = ox.gdfs_to_graph(london_nodes, london_edges)
I also keep getting back the following error:
~/miniconda3/lib/python3.6/site-packages/osmnx/save_load.py in gdfs_to_graph(gdf_nodes, gdf_edges)
600 G = nx.MultiDiGraph()
601 G.graph['crs'] = gdf_nodes.crs
--> 602 G.graph['name'] = gdf_nodes.gdf_name.rstrip('_nodes')
603
604 # add the nodes and their attributes to the graph
~/miniconda3/lib/python3.6/site-packages/pandas/core/generic.py in __getattr__(self, name)
4374 if self._info_axis._can_hold_identifiers_and_holds_name(name):
4375 return self[name]
-> 4376 return object.__getattribute__(self, name)
4377
4378 def __setattr__(self, name, value):
AttributeError: 'GeoDataFrame' object has no attribute 'gdf_name'
nodes have been saved before as:
london_nodes = ox.save_load.graph_to_gdfs(G, nodes=True, edges=False)
and edges as:
london_edges = ox.save_load.graph_to_gdfs(G, nodes=False, edges=True)
Thanks in advance.
python geospatial osmnx
add a comment |
up vote
1
down vote
favorite
I try the following code:
G = ox.graph_from_place('Greater London, UK', network_type='walk')
But it keeps giving the following error:
ConnectionError: HTTPSConnectionPool(host='nominatim.openstreetmap.org', port=443): Max retries exceeded with url: /search?format=json&limit=1&dedupe=0&polygon_geojson=1&q=Greater+London%2C+UK (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f50301d5470>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
Anyone knows anything about this bug?
Also is there a way to construct a Graph in osmnx from edges & nodes?
From the Following code:
G = ox.gdfs_to_graph(london_nodes, london_edges)
I also keep getting back the following error:
~/miniconda3/lib/python3.6/site-packages/osmnx/save_load.py in gdfs_to_graph(gdf_nodes, gdf_edges)
600 G = nx.MultiDiGraph()
601 G.graph['crs'] = gdf_nodes.crs
--> 602 G.graph['name'] = gdf_nodes.gdf_name.rstrip('_nodes')
603
604 # add the nodes and their attributes to the graph
~/miniconda3/lib/python3.6/site-packages/pandas/core/generic.py in __getattr__(self, name)
4374 if self._info_axis._can_hold_identifiers_and_holds_name(name):
4375 return self[name]
-> 4376 return object.__getattribute__(self, name)
4377
4378 def __setattr__(self, name, value):
AttributeError: 'GeoDataFrame' object has no attribute 'gdf_name'
nodes have been saved before as:
london_nodes = ox.save_load.graph_to_gdfs(G, nodes=True, edges=False)
and edges as:
london_edges = ox.save_load.graph_to_gdfs(G, nodes=False, edges=True)
Thanks in advance.
python geospatial osmnx
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I try the following code:
G = ox.graph_from_place('Greater London, UK', network_type='walk')
But it keeps giving the following error:
ConnectionError: HTTPSConnectionPool(host='nominatim.openstreetmap.org', port=443): Max retries exceeded with url: /search?format=json&limit=1&dedupe=0&polygon_geojson=1&q=Greater+London%2C+UK (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f50301d5470>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
Anyone knows anything about this bug?
Also is there a way to construct a Graph in osmnx from edges & nodes?
From the Following code:
G = ox.gdfs_to_graph(london_nodes, london_edges)
I also keep getting back the following error:
~/miniconda3/lib/python3.6/site-packages/osmnx/save_load.py in gdfs_to_graph(gdf_nodes, gdf_edges)
600 G = nx.MultiDiGraph()
601 G.graph['crs'] = gdf_nodes.crs
--> 602 G.graph['name'] = gdf_nodes.gdf_name.rstrip('_nodes')
603
604 # add the nodes and their attributes to the graph
~/miniconda3/lib/python3.6/site-packages/pandas/core/generic.py in __getattr__(self, name)
4374 if self._info_axis._can_hold_identifiers_and_holds_name(name):
4375 return self[name]
-> 4376 return object.__getattribute__(self, name)
4377
4378 def __setattr__(self, name, value):
AttributeError: 'GeoDataFrame' object has no attribute 'gdf_name'
nodes have been saved before as:
london_nodes = ox.save_load.graph_to_gdfs(G, nodes=True, edges=False)
and edges as:
london_edges = ox.save_load.graph_to_gdfs(G, nodes=False, edges=True)
Thanks in advance.
python geospatial osmnx
I try the following code:
G = ox.graph_from_place('Greater London, UK', network_type='walk')
But it keeps giving the following error:
ConnectionError: HTTPSConnectionPool(host='nominatim.openstreetmap.org', port=443): Max retries exceeded with url: /search?format=json&limit=1&dedupe=0&polygon_geojson=1&q=Greater+London%2C+UK (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f50301d5470>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
Anyone knows anything about this bug?
Also is there a way to construct a Graph in osmnx from edges & nodes?
From the Following code:
G = ox.gdfs_to_graph(london_nodes, london_edges)
I also keep getting back the following error:
~/miniconda3/lib/python3.6/site-packages/osmnx/save_load.py in gdfs_to_graph(gdf_nodes, gdf_edges)
600 G = nx.MultiDiGraph()
601 G.graph['crs'] = gdf_nodes.crs
--> 602 G.graph['name'] = gdf_nodes.gdf_name.rstrip('_nodes')
603
604 # add the nodes and their attributes to the graph
~/miniconda3/lib/python3.6/site-packages/pandas/core/generic.py in __getattr__(self, name)
4374 if self._info_axis._can_hold_identifiers_and_holds_name(name):
4375 return self[name]
-> 4376 return object.__getattribute__(self, name)
4377
4378 def __setattr__(self, name, value):
AttributeError: 'GeoDataFrame' object has no attribute 'gdf_name'
nodes have been saved before as:
london_nodes = ox.save_load.graph_to_gdfs(G, nodes=True, edges=False)
and edges as:
london_edges = ox.save_load.graph_to_gdfs(G, nodes=False, edges=True)
Thanks in advance.
python geospatial osmnx
python geospatial osmnx
edited Nov 8 at 9:55
asked Nov 8 at 9:35
Spartan
61111
61111
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Regarding your first question about the ConnectionError, it just looks like the Overpass API was down. It should work if you try again.
Regarding your second question, yes you can convert between MultiDiGraphs and GeoDataFrames:
import osmnx as ox
ox.config(log_console=True, use_cache=True)
G = ox.graph_from_place('Piedmont, CA, USA', network_type='drive')
nodes, edges = ox.graph_to_gdfs(G)
G2 = ox.gdfs_to_graph(nodes, edges)
As you can see from your error message, OSMnx does however expect all of its "expected machinery" to be present for the conversion (including a gdf_name attribute on the GeoDataFrames, for example). You can't convert just any old GeoDataFrames.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Regarding your first question about the ConnectionError, it just looks like the Overpass API was down. It should work if you try again.
Regarding your second question, yes you can convert between MultiDiGraphs and GeoDataFrames:
import osmnx as ox
ox.config(log_console=True, use_cache=True)
G = ox.graph_from_place('Piedmont, CA, USA', network_type='drive')
nodes, edges = ox.graph_to_gdfs(G)
G2 = ox.gdfs_to_graph(nodes, edges)
As you can see from your error message, OSMnx does however expect all of its "expected machinery" to be present for the conversion (including a gdf_name attribute on the GeoDataFrames, for example). You can't convert just any old GeoDataFrames.
add a comment |
up vote
0
down vote
Regarding your first question about the ConnectionError, it just looks like the Overpass API was down. It should work if you try again.
Regarding your second question, yes you can convert between MultiDiGraphs and GeoDataFrames:
import osmnx as ox
ox.config(log_console=True, use_cache=True)
G = ox.graph_from_place('Piedmont, CA, USA', network_type='drive')
nodes, edges = ox.graph_to_gdfs(G)
G2 = ox.gdfs_to_graph(nodes, edges)
As you can see from your error message, OSMnx does however expect all of its "expected machinery" to be present for the conversion (including a gdf_name attribute on the GeoDataFrames, for example). You can't convert just any old GeoDataFrames.
add a comment |
up vote
0
down vote
up vote
0
down vote
Regarding your first question about the ConnectionError, it just looks like the Overpass API was down. It should work if you try again.
Regarding your second question, yes you can convert between MultiDiGraphs and GeoDataFrames:
import osmnx as ox
ox.config(log_console=True, use_cache=True)
G = ox.graph_from_place('Piedmont, CA, USA', network_type='drive')
nodes, edges = ox.graph_to_gdfs(G)
G2 = ox.gdfs_to_graph(nodes, edges)
As you can see from your error message, OSMnx does however expect all of its "expected machinery" to be present for the conversion (including a gdf_name attribute on the GeoDataFrames, for example). You can't convert just any old GeoDataFrames.
Regarding your first question about the ConnectionError, it just looks like the Overpass API was down. It should work if you try again.
Regarding your second question, yes you can convert between MultiDiGraphs and GeoDataFrames:
import osmnx as ox
ox.config(log_console=True, use_cache=True)
G = ox.graph_from_place('Piedmont, CA, USA', network_type='drive')
nodes, edges = ox.graph_to_gdfs(G)
G2 = ox.gdfs_to_graph(nodes, edges)
As you can see from your error message, OSMnx does however expect all of its "expected machinery" to be present for the conversion (including a gdf_name attribute on the GeoDataFrames, for example). You can't convert just any old GeoDataFrames.
answered yesterday
gboeing
37616
37616
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53204952%2fhow-to-download-and-constrtuct-a-graph-in-osmnx%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password