Trip Modifications
Trip Modifications allow producers to modify certain static features of a trip in real-time, including their shape, what stops they serve, and new stops that are not included in the static trip. Trip Modifications are useful for quickly displaying unplanned or short-term detours caused by construction, emergencies, or events.
When agencies publish a GTFS Trip Modifications feed, Transit has all the necessary information to display the detour made by a trip, making it possible for riders to plan around detoured routes in real-time.
If your goal is to give users advanced warning of a coming Trip Modification, or engage in rider communications about a detour, it is recommended to publish a service alert (see our article about service alerts here).
In this article:
Publishing trip modifications
Trip Modifications can be published at a separate protobuf source, but may also be provided within the Trip Updates feed. Please note that consumption of Trip Modifications is not automatic and would need to be configured by Transit. Contact us at data@transit.app for more information.
Best practices
Transit supports all fields outlined in the GTFS Trip Modifications specification, which provides detailed requirements for each field. The following best practices should also be noted:
- Each Modification defines an inclusive selection of stops, meaning the start stop and end stop, as well as the stops in between, are considered modified.
- Transit prefers stop_sequence over stop_id in the StopSelector as it is more robust. However, providing both ensures that Transit can use stop_id if the stop_sequence is inaccurate.
- Ensure the shape_id represents the full trip, not only the detoured section.
- Include replacement stops - The Modification message can include a list of temporary, ReplacementStops. These stops can already exist in the GTFS, or reference a new Stop message. If replacement stops are not provided, users will not be able to see the exact location of where they can embark or disembark on the detoured routes.
Maintaining real-time information
At temporary stops
If travel_time_to_stop is provided, Transit will incorporate the relative delay value into the realtime TripUpdates at the replacement/temporary stops. Otherwise, Transit will use its own prediction algorithm to determine the realtime Trip Updates at the temporary stops.
It is also possible to explicitly provide Trip Updates to replacement stops by including additional modified Trip Updates in the Trip Update feed that Link to the Trip Modifications. This allows the producer to control the accuracy of the realtime information at the temporary stops.
At stops at the end of a detour
The propagated_modification_delay adds an optional delay value to all stops following the last stop of the Modification, when the vehicle resumes its scheduled routing. Transit will apply the delay to the arrival/departure values in your TripUpdates
When using Automatic Detour Detection, Transit will also automatically propagate real-time to the temporary stops.
How it’s displayed
Published Trip Modifications will be visible in Transit within 5-15 minutes.
Transit uses Trip Modifications to alter the static information in the app. Users will only see Trip Modifications that are currently active, and relevant to their current location and their trip plan.
Cancelled stops are removed from the Stop List. If replacement stops are included in the trip modification, they are added to the Stop List with the label “Temporary stop.”
