Repository navigation
Closed
Labels
Description
trip_id is quickly outdated/out-of-sync between local static and online real-time data.
For non-frequency based schedule (99%):
trip_id(&start_date) (&start_time?)route_id&direction_id(&start_date) &start_timestart_dateis optional because we can guess the "current" trip by picking the closest one.
Current MT implementation:
- if
TripDescriptorcontains atrip_id, it must match - if
TripDescriptorcontains aroute_id, it must match - if
TripDescriptorcontains adireciton_id(& not ignored), it must match - (Alerts only) must also match on
stop_id,route_type,agency_idif inTripDescriptor
Current MT fallback for trip IDs mismatch:
- Service Alerts: primary target UUID (route+direction+stop)
- Vehicle Positions: primary target UUID (route+direction)
- Trip Updates: (none)
Issues:
TripDescriptor'sdirection_iddifferent than 0 or 1- should be always ignored by default GTFS-RT > static<>real-time matching (out-of-sync
trip_id...) & tests #117
- should be always ignored by default GTFS-RT > static<>real-time matching (out-of-sync
- Service Alerts:
trip_idshould be optional ifroute_id,direction_idandstop_idare used appropriately. - Vehicle Positions:
trip_idshould be optional ifroute_idanddirection_idare provided - Trip Updates:
trip_idare the best match when in-sync, alternatives can be quite complex- ?
- how do we know if
trip_idsare outdated/out-of-sync between static & real-time data? or if we just don't have any data for the currentTripDescriptor(filter)?- should we parse the real-time response and check if the 1st trip ID is inside the local DB to know if trip IDs match or not?
- once we know trip ID do not match, how can we try to match local trip IDs with real-time trip IDs GTFS-RT > static<>real-time matching (out-of-sync
trip_id...) & tests #117- use
TripDescriptor- >start_timeif provided to match with local data? thenStopTimeUpdate.stop_idmust match? - ...
- use
Links:
- Select a trip with TripDescriptor - Transit Partners Help
- https://gtfs.org/documentation/realtime/feed-entities/service-alerts/#entityselector
- https://gtfs.org/documentation/realtime/realtime-best-practices/#tripdescriptor
- https://gtfs.org/documentation/realtime/feed-entities/trip-updates/#tripdescriptor
Activity
mmathieum commentedon May 4, 2026
OC Transpo: trip IDs to not match at all. Even stop IDs do not match 😞