kuanb / peartree

peartree: A library for converting transit data into a directed graph for sketch network analysis.
MIT License
201 stars 23 forks source link

Multimodal graph linking not working? #153

Open HTenkanen opened 4 years ago

HTenkanen commented 4 years ago

Hi again @kuanb,

I continued digging around (see #124) and tested using the existing_graph -parameter to link walking and PT graphs together. I found that the stops around transit areas are connected together, but edges that would link stops to road network does not seem to work (as in the example below). Is this expected behavior?

image

The code that I used to produce the graph is:

G = pt.load_feed_as_graph(feed, start, end, 
                                 walk_speed_kmph=walk_speed,
                                 impute_walk_transfers=False,
                                 use_multiprocessing=True,
                                 existing_graph=walk_graph)
kuanb commented 4 years ago

Interesting - I will look into this further! Thank you for flagging!

d3netxer commented 3 years ago

I looked into this, and this is connected to the 'hanging nodes' issue from the peartree with walk tutorial: http://kuanbutts.com/2018/12/24/peartree-with-walk-network/

When a network is obtained via OSMNX the node IDs are ints, so we want to preserve these ints instead of converting them to strings. Or else, we will be creating hanging nodes and also be ignoring nearest nodes that come from the existing graph. I am submitting this pull request: https://github.com/kuanb/peartree/pull/164