-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
osm.pdna_network_from_bbox error #181
Comments
Hi @SHITIANYU-hue it looks like you do not have the optional package OSMnet installed in order to use that OSM network download function and thats why you have a geodataframe with no geometry column, see the error: |
I encountered the same error but I do have the OSMnet package installed. |
Same here. pandana 0.6.1 |
the error originates from osmnet, which pandana uses under the hood. The issue has been fixed upstream, so you can install the dev version of osmnet to get this working until a new release is made over there. until then you could use osmnx to get the tables you need to input into pandana. Something like this should work def pdna_network_from_gdf(gdf, network_type='walk'):
graph = ox.graph_from_polygon(gdf.unary_union, network_type=network_type)
n,e= ox.utils_graph.graph_to_gdfs(graph, geometry=False)
e = e.reset_index()
return pdna.Network(edge_from=e['u'], edge_to=e['v'], edge_weights=e[['length']], node_x=n['x'], node_y=n['y']) |
Thanks @knaaptime, I tried the However the
error. Guess I'll try the dev version of osmnet instead now. |
in the func i gave above the impedance column is "length", so maybe try (or you could rename the column from the edge table |
in the demo, when i run :
network = osm.pdna_network_from_bbox(37.698, -122.517, 37.819, -122.354) # San Francisco, CA
There will be error: ValueError: Assigning CRS to a GeoDataFrame without a geometry column is not supported. Use GeoDataFrame.set_geometry to set the active geometry column.
The text was updated successfully, but these errors were encountered: