{"action":"created","issue":{"url":"https://api.github.com/repos/google/transit/issues/16","repository_url":"https://api.github.com/repos/google/transit","labels_url":"https://api.github.com/repos/google/transit/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/google/transit/issues/16/comments","events_url":"https://api.github.com/repos/google/transit/issues/16/events","html_url":"https://github.com/google/transit/pull/16","id":125411073,"number":16,"title":"Clarify behavior for dropping StopTimeUpdates for vehicles running ahead of schedule","user":{"login":"barbeau","id":928045,"avatar_url":"https://avatars.githubusercontent.com/u/928045?v=3","gravatar_id":"","url":"https://api.github.com/users/barbeau","html_url":"https://github.com/barbeau","followers_url":"https://api.github.com/users/barbeau/followers","following_url":"https://api.github.com/users/barbeau/following{/other_user}","gists_url":"https://api.github.com/users/barbeau/gists{/gist_id}","starred_url":"https://api.github.com/users/barbeau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barbeau/subscriptions","organizations_url":"https://api.github.com/users/barbeau/orgs","repos_url":"https://api.github.com/users/barbeau/repos","events_url":"https://api.github.com/users/barbeau/events{/privacy}","received_events_url":"https://api.github.com/users/barbeau/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/google/transit/labels/cla:%20yes","name":"cla: yes","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-01-07T15:06:46Z","updated_at":"2016-02-03T09:08:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/google/transit/pulls/16","html_url":"https://github.com/google/transit/pull/16","diff_url":"https://github.com/google/transit/pull/16.diff","patch_url":"https://github.com/google/transit/pull/16.patch"},"body":"In the \"Stop Time Updates\" section, the [GTFS-realtime spec](https://developers.google.com/transit/gtfs-realtime/trip-updates#stop-time-updates) says:\r\n\r\n>A trip update consists of one or more updates to vehicle stop times, which are referred to as StopTimeUpdates. These can be supplied for past and future stop times. You are allowed, but not required, to drop past stop times. When doing this, be aware that you shouldn't drop a past update if it refers to a trip that isn't yet scheduled to have finished (i.e. it finished ahead of schedule) as otherwise it will be concluded that there is no update on this trip.”\r\n\r\nMy interpretation of the highlighted portion is that when multiple StopTimeUpdates exist in a trip (i.e., per-stop predictions), individual StopTimeUpdates shouldn't be dropped from the GTFS-rt feed if the vehicle is running ahead of schedule until *after* the scheduled arrival time for that stop (from GTFS stop_times.txt).\r\n\r\nFor example, if the following data appears in the GTFS-rt feed:\r\n\r\n* Stop 4 –Predicted at 10:18am (scheduled at 10:20am – 2 min early)\r\n* Stop 5 –Predicted at 10:30am (scheduled at 10:30am – on time)\r\n\r\n...the prediction for Stop 4 cannot be dropped from the feed until 10:21am, even if the bus actually passes the stop at 10:18am.  If the StopTimeUpdates for Stop 4 was dropped from the feed at 10:18am or 10:19am, and the scheduled arrival time is 10:20am, then the consumer should assume that no real-time information exists for Stop 4 at that time.\r\n\r\nA vendor is arguing that this text applies only to the TripUpdate, not to the StopTimeUpdates, and they are allowed to drop updates for vehicles running early as soon as the vehicle passes the stop (no matter what the scheduled arrival time is).  If the vendor's interpretation is correct, it results in a very poor end user experience for consumers - for example, if a vehicle was running 5 minutes early, and the user checks their app 4 minutes before the scheduled arrival time, the app would only show scheduled information, and would show that the vehicle was expected to arrive in 4 minutes (even though at a system level we know that the vehicle already passed the stop).\r\n\r\nI'm proposing this change to clarify the expected behavior in the context of dropping StopTimeUpdates with a vehicle running ahead of schedule.\r\n\r\nSee also https://groups.google.com/forum/#!topic/gtfs-realtime/3rAf6UIhAsQ."},"comment":{"url":"https://api.github.com/repos/google/transit/issues/comments/179108366","html_url":"https://github.com/google/transit/pull/16#issuecomment-179108366","issue_url":"https://api.github.com/repos/google/transit/issues/16","id":179108366,"user":{"login":"magdalar","id":8465520,"avatar_url":"https://avatars.githubusercontent.com/u/8465520?v=3","gravatar_id":"","url":"https://api.github.com/users/magdalar","html_url":"https://github.com/magdalar","followers_url":"https://api.github.com/users/magdalar/followers","following_url":"https://api.github.com/users/magdalar/following{/other_user}","gists_url":"https://api.github.com/users/magdalar/gists{/gist_id}","starred_url":"https://api.github.com/users/magdalar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magdalar/subscriptions","organizations_url":"https://api.github.com/users/magdalar/orgs","repos_url":"https://api.github.com/users/magdalar/repos","events_url":"https://api.github.com/users/magdalar/events{/privacy}","received_events_url":"https://api.github.com/users/magdalar/received_events","type":"User","site_admin":false},"created_at":"2016-02-03T09:08:06Z","updated_at":"2016-02-03T09:08:06Z","body":"+1"}}