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

preserving node id types from original graph #164

Open d3netxer opened 3 years ago

d3netxer commented 3 years ago

fixes 'hanging nodes' and issue #153

kuanb commented 3 years ago

Thanks @d3netxer I see 2 main changes in this PR:

  1. indexes are kept as numerical values and not strings
  2. make sure that cross feed edges get both to and from (bi-diretional)

I've got a question about 1 - did you find this would problematic and causing the hanging node issues and adjusting 1 alone did not address the issue? I can look into it further.

d3netxer commented 3 years ago

@kuanb adjusting 1 alone fixed the hanging node issue. This would create cross-edges in one direction connecting stops to nearby OSM nodes. However, I noticed that in some cases in my graph, the faster transit line wasn't being included in the shortest path. This was because a one-directional edge went either from the OSM node to the stop, therefore a rider could not get off the stop. Or a a one-directional edge went only from the stop to the OSM node, and therefore a rider could only get off the stop, but not get on. Therefore I added bi-directional edges in 2.

d3netxer commented 3 years ago

I would like to have the option to add an attribute to graph edges that represents the number of trips that pass through an edge. This would be good to checking my GTFS data. I am making a pull request that adds this feature.