Deprecate TripUpdate.schedule_relationship = ADDED, add TripUpdate.schedule_relationship = NEW / REPLACEMENT to specify new / replaced trips which do not run on a schedule from the GTFS static.#504
Conversation
…elds in TripProperties and StopTimeProperties to support fields needed for such trips
|
Nice to see some movement in that direction! I think you used a markdown editor that changed formatting on a lot of tables which makes it hard to see the actual diff from your proposal. Would it be possible to fix that? You put a lot in the PR description that's not actually in the proposed changes. Is that just to start the discussion? Some of it is quite consequential, like I'm a bit puzzled on how a consumer is supposed to ingest ADDED changes like this with arbitrary trips with no more information than an headsign. Which route is that on? Is those added trips supported only on existing routes in the GTFS? If the answer is no, we're getting quite close to the service change proposal : https://bit.ly/gtfs-service-changes-v3_1 |
|
Thanks for opening this PR! OTP has had an implementation of ADDED for a long time but its behaviour is severely underspecified. I'd love to formalise it. Yes, OTP allows you to create completely new free form trips that have no relation to an existing pattern or trip. It tries match the given route id to an existing one but if none is in the message a dummy one is created. For once, OTP is really following the "just give us what you have, and we will try to work it out" strategy. The only requirement we have is that the stop ids must match the static GTFS. The question is what should happen when they don't. Should the entire update be dropped or individual stops? Does that even need to be specified? I agree with what @gcamp said about the markdown tables and the issue description. Lastly, you might find it easier to get this through review if you split it into two PRs: one for ADDED and one for REPLACEMENT. That's just a guess though. |
|
I think that the requirement for the whole trip to be specified is written in the code. Let me know if it is not clear enough. I'll fix the formatting later today. |
"The whole journey of the added trip must be specified" is a fact in the core of this PR, noted in the updated definition of
The route and direction of the ADDED trip is specified in |
|
I do not want to specify the behaviour of missing stops at this moment because it may depend on the client's capability for dynamically adding stops via |
|
So this is pretty much a codifcation of what OTP has been supporting for several years. This would of course be very convenient for us but I would like to hear more voices from the community, in particular producers. I know that HSL (Helsinki) is using this as both a producer and consumer (OTP) for many years. MBTA has also indicated that they use ADDED as a producer. @optionsome @jfabi @sam-hickey-ibigroup |
Accept suggestion by @leonardehrenfried for definition of TripUpdate.ScheduleRelationship = ADDED Co-authored-by: Leonard Ehrenfried <mail@leonard.io>
formatting fix Co-authored-by: Leonard Ehrenfried <mail@leonard.io>
Producing it for over 12 years too. |
HSL doesn't produce or consume ADDED or REPLACEMENT updates currently, if that was what you were referring to. |
|
What happens when you ADD a trip and then CANCEL it again? Should it be become invisible in the system ( |
|
That's a good question. I still need to think about how things will work. My producer implementation cancels an added trip using TripUpdate.schedule_relationship = The questions are that:
|
|
As we are considering |
|
Actually, @skinkie is right. If you use FULL_DATASET then the moment you fetch the new version of the RT feed the old ADDED trip will completely vanish and it neither exists as DELETED nor CANCELLED. It's like it never existed. However, once there is movement towards specifying INCREMENTAL we will have to revisit this. |
|
Does anyone know how Google and Apple handle ADDED? @eliasmbd I don't know who the relevant person from Apple would be. Could you tag them? |
|
@leonardehrenfried at Google the thing was limited to stop sequences previously observed. Hence if the ADDED trip was an instance of a stop sequence that is part of the database, it could be processed. I don't know if it is already capable of processing a partial instance of a stop sequence. https://support.google.com/transitpartners/answer/10106497?hl=en#zippy=%2Cadd-with-tripupdates |
|
@sam-hickey-arcadis The CLA check now fails because I have applied some of your review suggestions. |
That's a fair and good point.
What about using I think this needs to be formalized in the specification, but that could happen in the future (at a minimum, before removing the experimental tags). I don't think that needs to happen now and doesn't need to hold up this vote. |
I'm working on this. |
|
+1 Arcadis |
|
+1 Google I will say that I share some of the same concerns raised by @SteveGladstone and @sam-hickey-arcadis about |
|
+1 Maryland Transit Administration. Looking forward to leveraging NEW trip functionality 😄 |
jfabi
left a comment
There was a problem hiding this comment.
+1 from the @mbta—as heavy users of ADDED trips, especially on our subway system, we're very excited for this new standardization of added and modified service, as well as for potential applications such as defining bus bridges.
|
The voting is now closed. There are 9 votes supporting this proposal and 1 abstention. Therefore the proposal is passed. There are a few grammatic changes needed as mentioned by @bdferris-v2 before merging. I'll handle them tomorrow. |
The editorial changes have been done, waiting for @sam-hickey-arcadis to complete his CLA such that this PR can be merged. |
…ned in reference.md
0db0b68 to
9ba6c4d
Compare
@sam-hickey-arcadis the CLA is still hasn't done yet |
I am working on this. Will have it complete ASAP. |
|
We submitted a corporate CLA to Google two days ago but have not received the DocuSign that they say is the next step. As soon as we receive that, we will sign it and the CLA check here should then succeed. |
Arcadis finally received the DocuSign this morning. It has been signed and the CLA rescan completed. |
OK, this should be ready to be merged. |
The use of
TripUpdate.schedule_relationship = ADDEDwas unspecified and different producers / consumers used it in different ways. For example, it is sometimes used to specify additional departures on an existing route, but it is also used to specify departures which can't be matched to any existing trips.This PR attempts to fully deprecate ADDED, and introduce NEW and REPLACEMENT, based on the implementation of OpenTripPlanner which specifies the whole journey to be added or replaced. Additional fields, such as headsigns, and pickup / drop-off types, are introduced as required to support the full specification of completely new trips.
NEWIn this proposal,
TripUpdate.schedule_relationship = NEWshould be used to add trips which do not duplicate an existing trip. Such trips are considered to be unrelated to any existing trips in the GTFS Static and can serve an arbitrary pattern, including completely new patterns not found in the GTFS Static.A typical use case is for relief trips for extra demand, typically after big events.
NEW trips are intended as a migration target for existing feeds which use ADDED to specify new trips unrelated to the static GTFS, including OpenTripPlanner.
trip_idin theTripDescriptorfor new trips must be completely new (not found in GTFS static) and unique, and astart_dateshould also be specified as well (I am not using the word "must" here because it is permitted not to specify start_date to match scheduled trips, in this case the trip is assumed to run today).The whole journey of the added trip must be specified, in stop order, as
StopTimeUpdates inside theTripUpdatewithout any omission. Fields are added toTripPropertiesandStopTimePropertiesfor esssential information such as names, headsigns, pickup / drop off types.REPLACEMENTI propose to un-deprecate
TripUpdate.schedule_relationship = REPLACEMENTas well. It works in the same way asNEW, apart from that theTripDescriptormust match one instance of a scheduled trip (like other values ofTripUpdate.schedule_relationship), and that instance is replaced with the complete replacement trip specified in form ofStopTimeUpdates like an added trip. The original stop times in the GTFS static are not considered by the replacement trip in any form to avoid confusion. The replacement trip can serve an arbitrary pattern with an arbitrary schedule, the only expectation is that the passenger should associate the replacement trip to actually be a replacement of the original trip.A typical use case is for short-term timetable change, or short-term (near real-time) diversion, where the fact that the
trip_idremains the same can be used by journey planners to notify the user that the booked service has been changed. (In particular, I have successfully used this feature to handle real-time train diversions in GB in OpenTripPlanner and route users to alight at diverted stops, which is something neither Google Maps nor Citymapper can do now)This is the behaviour implemented in OpenTripPlanner, which is equivalent to deleting the matched trip, and processing the replacement
TripUpdateas an ADDED trip mentioned above.Relationship to
TripModificationTripModificationprovides a way to modify trips en-masse by specifying a list of trip IDs where the same detour can be applied. However, it is not suited to change the schedule on a per-trip basis, replacing the trip with a completely different schedule after any diversions with different running times (common due to pathing constraints on railways).It should be forbidden to modify the same trip via a
REPLACEMENTtrip update and also via aTripModification.