Comments (5)
I see. Thank you!
from pandana.
Hi @kaidiwang! Just wondering what are you calling with the call_client
? If I try both methods getting the nodes from the net
object I'm always getting results for both shortest path methods
from pandana.
The call_client.origin is 5062 and call_client.destination is 6235.
Hi @kaidiwang! Just wondering what are you calling with the
call_client
? If I try both methods getting the nodes from thenet
object I'm always getting results for both shortest path methods
from pandana.
hey @kaidiwang how are you? I found out that what you get with 5062 and 6235 is not happening just for this pair of nodes. There are some other node pairs with the same behavior.
If you look for them in your edges gdf you will see that these pairs are not connected. So, when creating your net object with nodes and edges gdf you are creating a graph where nodes can be connected or not. That's why you get that empty list when calling the shorest path method
from pandana.
Exploring it further, I would suggest to:
- Create the
net
object from the same source (geodataframe of links):
connected_nodes = np.unique(gdf_links[['o_nodeidx','d_nodeidx']])
gdf_nodes_ = gdf_nodes.loc[gdf_nodes.index.isin(connected_nodes)].copy()
net_ = pdna.Network(gdf_nodes_['X'], gdf_nodes_['Y'],
gdf_links['o_nodeidx'], gdf_links['d_nodeidx'],
gdf_links[['TIMAU']], twoway = False)
This way, if you try to get the shortest_path_distance
from non connected nodes you will get a nan
error as feedback. The nodes are not connected, so the error would be the correct output.
The problem with pandana here is that it returns a shortest_path_distance
value (that has no sense) instead of 0 or non connected nodes warning.
- If you want to work with all the nodes (even if some of them are not connected) you can use the
low_connectivity
method:
number_of_edges = len(np.unique(net.edges_df[['from','to']]))
number_of_nodes = len(net.nodes_df.index.unique())
# directed graph
node_degree = number_of_edges/number_of_nodes
max_imp = gdf_links['TIMAU'].max()
low_connected_nodes = net.low_connectivity_nodes(impedance=max_imp, count=node_degree*2)
The low_connected_nodes would be a list of nodes to filter or exclude
(cc @sablanchard @smmaurer )
from pandana.
Related Issues (20)
- [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 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
- osm.pdna_network_from_bbox error HOT 6
- Pulling network object from OSM bugged HOT 2
- New release ?
- Google Colab install pandana error HOT 1
- query the OSM API for the street network within the specified bounding box error HOT 1
- OSM Network Loader Error HOT 1
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.