Comments (6)
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: modulenotfounderror
in the traceback. try installing that package and trying it again. Ill close this issue for now.
from pandana.
I encountered the same error but I do have the OSMnet package installed.
from pandana.
Same here.
pandana 0.6.1
osmnet 0.1.6
geopandas 0.11.0
from pandana.
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'])
from pandana.
Thanks @knaaptime, I tried the pdna_network_from_gdf
fix together the Pandana example. Removed geometry=False
, because it triggers another error (TypeError: graph_to_gdfs() got an unexpected keyword argument 'geometry'
) which seems due to the Osmnx version I use.
However the lcn = network.low_connectivity_nodes(impedance=1000, count=10, imp_name='distance')
from the example then triggers a
line 395, in _imp_name_to_num assert imp_name in self.impedance_names, "An impedance with that name" \AssertionError: An impedance with that namewas not found
error. Guess I'll try the dev version of osmnet instead now.
from pandana.
in the func i gave above the impedance column is "length", so maybe try imp_name='length'
(or you could rename the column from the edge table e=e.rename(columns={'length':'distance'})
)
from pandana.
Related Issues (20)
- Support for Python 3.9 HOT 1
- Support for MacOS 11.0 Big Sur HOT 2
- Support for M1 Macs HOT 3
- [Question] How to get different Key|Value combinations in osm.node_query
- [Feature Request] Aggreggation queries to subset of nodes
- Binary incompatibility error with older versions of NumPy HOT 1
- Shortest path length exists but shortest path is empty HOT 5
- shortest path distance between non connected nodes
- Allow specifying mapping distance for POIs
- Issue: the POI Accessibility computation is taking forever
- OSM loader - POIs that are ways in OSM HOT 1
- Pandana network initiation slow for large network HOT 4
- how to increase the performance of the aggregate when impedance is changed to time?
- net.shortest_paths doesn't work with multiprocessing
- tables sub-dependency versions conflict with python 3.10 compatibility when installing with pip HOT 1
- incorrect shortest paths solutions when impendance values are particularly small or large HOT 1
- Plotting with Pandana does not render title HOT 1
- Pulling network object from OSM bugged HOT 2
- New release ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandana.