-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify behavior for "schedule_relationship: SKIPPED" in StopTimeUpdates #139
Clarify behavior for "schedule_relationship: SKIPPED" in StopTimeUpdates #139
Conversation
I wouldn't say this clarifies the behaviour, more that is changes it. My interpretation from the your research is that a 2 agencies use SKIPPED incorrectly. The previous behaviour might not be obvious, but it wasn't ambiguous : there was always a propagation. But this seems even more confusing to me. To me the fix should be to make the propagation behaviour more obvious in the spec, not to change the behaviour. I've seen agencies misuse the propagation behaviour of |
@gcamp Are you saying that currently the |
@barbeau The The current spec says
Any update is propagated, not only the delay, the entire update is. Doesn't that mean the |
@gcamp I've never interpreted the spec this way, although given the text I can see how you could assume this (hence this PR to clarify things :)). I've read "update" referring to the delay within the STU, not the entire STU. My rationale - there are fields in the StopTimeUpdate that obviously can't be propagated, like Coincidentally, it looks like folks working on OneBusAway just implemented And yes, I do plan to revisit improving the definition of arrival/departure time propagation previously discussed in #110. Also, what do you mean by:
|
I've had to explain the propagation behaviour multiple times for agencies because they don't expect propagation at all. Even with It's quite possible I've misunderstood the propagation for I'm curious about other implementations of this that can way in here, the OTP example is a good one. If we are the only implementation that does it this way, we'll certainly change it. |
@abyrd, @sdjacobs, or @drewda Are you able to describe how OTP handles GTFS-rt |
I'm not sure what OTP does. If @TheTransitClock makes use of |
Unfortunately, OpenTripPlanner does not support SKIPPED stops. It'll simply discard TripUpdates that have StopTimeUpdates which have ScheduleRelationship = SKIPPED: |
OpenTripPlanner GTFS-RT support was added in the context of the Plannerstack project in the Netherlands, and was built specifically to consume data in that context, where all data is being converted from local standards that do not align exactly with GTFS-RT. The details of how OTP handles GTFS-RT should not be interpreted as a position on how GTFS-RT should be interpreted, or used as a justification for any interpretation of the spec. Personally, I would probably assume the behavior @barbeau is suggesting in this PR: that delay (a derived value) would be propagated, but not fields like SKIPPED. I don't think there's much point in trying to guess or reason about what the specification "really means", I think the specification is just ambiguous and needs to be clarified. It's interesting that @gcamp says "I've had to explain the propagation behaviour multiple times for agencies because they don't expect propagation at all". I can definitely see the logic in not fabricating / extrapolating messages that were not sent by the producer. The Plannerstack project took this one step further and decided it would be better to refuse any message that didn't give a stop time update for every stop in a trip. But it seems like propagation is expected and desired by some data producers, who are relying on systems that only provide data about current status of vehicles and expect the consumer to figure out what effects that might have. I guess this is reasonable considering the overall spirit of GTFS being easy to produce to encourage widespread adoption. |
@TheTransitClock consumes GTFS real-time vehicle positions to perform its main function. It does not consume trip updates. So, it does not make use of SKIPPED. |
So here's a summary of existing behavior so far:
I'm checking with Google to see what their current behavior is. |
Ok, Google behavior is that I've updated a table in the first post with the current consumer behavior. @gcamp Would Transit be willing to change to not propagating Any more consumers that want to weigh in with existing behavior? |
Ok to change the behaviour on our side, I'm surprised nobody else interpreted the way we did however. But if Google did it this way, the sad truth is that it probably should be the reference implementation. I would also change this part in trip_update
to
|
In #144 @gcamp raised the question of whether a We're already touching that same text in this PR, so I've added further clarification in 8a0e003 that the propagation we're referring to also includes delays computed by comparing the provided |
@gcamp Any further thoughts on this proposal? I'd like to open a vote on this in the next few days. |
@barbeau all good for me |
This pull request has been open for more than one week, so per the Official Process I'm calling for a vote. Vote will be closed on Friday March 8th at 23:59:59 UTC. |
+1 |
+1 Had this discussion at over 2 years ago and ended up changing the yourstop implementation to be exactly the same as that proposed above |
+1 |
Voting is closed on this proposal and the results are: Yes - 3 So it passes! Thanks all! |
I maybe a bit late on this, but our implementation of various AVL data to GTFS-RT in our Urbiplan tool currently do the exact same thing as this proposal: that is propagating only delays, and not SKIPPED / NO_DATA entries. If I had to vote, I would have voted +1 (not that this matter much anyway, given the overall majority so far). |
To be completely exact, our internal propagation rules do a linear interpolation of delays between existing data (SCHEDULED) to fill missing entries. Otherwise in some occasion time travel can occurs, and just clamping delays can also lead to illogical results. We though at a time about interpolating SKIPPED entries in the case a set of missing stop times were surrounded by 2 SKIPPED, but that idea was dropped. |
@laurentg said:
This is a very good point. The default propagation behavior of just replicating the delay value until the point in the trip where a new one is provided can create incoherent results (negative travel times between stops, i.e. arriving at a downstream stop earlier than you depart from the upstream stop). This kind of complexities are the reason that we came to the conclusion that such propagation should ideally be handled by an external component with more sophisticated strategy and invariant checking. If simple propagation rules are a permanent part of the specification, they should be accompanied by some guidance on common pitfalls of this kind, to alert consumers of the additional checks and fixes they need to implement. By the way, likewise I would have voted +1. |
Past discussions regarding StopTimeUpdate.ScheduleRelationship
SKIPPED
values revealed that the exact behavior of the consumer isn't well defined in regards to whether theSKIPPED
value should be propagated to downstream stops, as well as whether delay values upstream of theSKIPPED
stop should be propagated downstream of theSKIPPED
stop.We did a review of existing use of SKIPPED values in feeds, and followed up with a few agencies to clarify their intentions when publishing when this wasn't clear from the feed itself.
This proposal clarifies that SKIPPED values should not be propagated downstream, and that delay values should
notbe propagated downstream of theSKIPPED
stop. EDIT Based on existing consumer behavior discussed below, delays will be propagated over theSKIPPED
stop (changed in 9efe24e).Announced on the GTFS-realtime Google Group at https://groups.google.com/forum/#!topic/gtfs-realtime/L07XRNypZrE.
EDIT:
Summary of exiting behavior