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

Prune NaN stop times to avoid underestimating wait times #131

Closed kuanb closed 5 years ago

kuanb commented 5 years ago

When a stop id has attributed stop times that have no value (see below example from Yuba, CA), wait times are very low.

image

In the case of the stop with these coordinates from Yuba's GTFS, the boarding cost is less than 18 seconds.

{'boarding_cost': 17.479853479853478,
 'x': -121.644406914711,
 'y': 39.138091019404}

Pruning these stops will improve stop wait time estimates.

kuanb commented 5 years ago

Update: Above screenshot would have been resolved with the interpolation of intermediary stops. But underlying problem is that there are wait times under 1 minute for rural lines somehow coming up.

Problem might be in generate_summary_wait_times when NaN values are pruned...

Here in Yuba City GTFS, we can see a number of essentially 0 minute boarding cost/wait time values for most of the nodes that are being generated, which is surprising: image