Open hamima-halim opened 4 months ago
So, the stop_id
that LAMP reports isn't consistent for these stops--sometimes the downstream processes will resolve the vehicle location's stop_id
to the numeric id (ie, 70001
) and sometimes they will use the alternate string one (ie, Forest-Hills-02
)
(Thanks to @JNuss71 for walking through this with me!)
https://github.com/transitmatters/mbta-performance/pull/18 adds a map that takes the Alpha stop_id
s to their numeric counterparts (notice that in Union Square, tracks 1 and 2 actually differ.) This fixes issues with the Orange line, but trips starting from Alewife and Union Square are still showing odd behavior. For better or worse, this is also consistent with the behavior coming out of the GTFS-realtime API and indicates that whatever is coming out of the AVL's (and their light downstream processing) isn't guaranteed to be consistent with what's expected from GTFS's stop/trip information.
Alewife (Alewife-01
, Alewife-02
) trips are still behaving oddly, even outside of the fact that all southbound trips on the Red line during this planned outage aren't assigned a trip_id
. I suspect theres some extra stop_id
edge case we aren't picking up correctly that affects Alewife but not Braintree.
The following
stop_id
's are report by LAMPGTFS, on the other hand, uses the numerical ID's for these stops in the
stops.txt
schedule (e.x.,70036
instead ofOak Grove-01
). This messes up some of the GTFS-based merges we have to do on thestop_id
column in this function https://github.com/transitmatters/mbta-performance/blob/a03170700e41d55b7e43d771b54787249f7c46b5/mbta-performance/chalicelib/lamp/ingest.py#L159We need a map that translates LAMP's versions of these ID's to their numerical counterparts. Its pretty important because these are the first/last stops of their respective lines, and this can really screw over the
route_starts
calculations in this line https://github.com/transitmatters/mbta-performance/blob/a03170700e41d55b7e43d771b54787249f7c46b5/mbta-performance/chalicelib/lamp/ingest.py#L170