trynmaps/metrics-mvp

Support Blending of Branches

EddyIonescu opened this issue · 0 comments

Currently stats can be returned only for individual branches. For example, someone wanting to see their commute between a local stop in Japantown and Downtown would have to choose between either the 38 Geary from VA Hospital or from Land's End, both of which have a median wait time of 5 minutes.

In cases where there are multiple branches, such as the TTC 52 Lawrence West route which has four branches (A, B, F, G) that run every 9, 23, 18, and 18 minutes respectively; the branches overlap for most of the route, but it's difficult to determine what the median wait-time or trip-times for the combined section are.

It's not an issue for trip-times, as those should generally be similar between branches operating on the same section (assuming they serve the same stops).

For wait-times, it should be possible to get the combined median wait-time by having get_headways (

def get_headways(self, direction_id, stop_id, rng: Range, scheduled=False):
) support multiple direction_id's, and updating the metrics API endpoint and the frontend.

Priority-wise, it doesn't seem that necessary for Muni and TriMet, but I plan on working on this once TTC is added as most of their routes have branches on the outer ends (similar to the 38 Geary), https://www.ttc.ca/PDF/Maps/TTC_SystemMap.pdf