-
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
stop_times.txt: Interpretation of times during daylight savings time transition #325
Comments
related: #15 (comment) |
@npaun and @derhuerst I'm not super familiar with the DST issue (as much as the timezone one) so please feel free to update my #328 to reflect a solution that meets your needs! |
First, I'll give my perspective on your specific statements:
Indeed, we must allow negative GTFS Time values to allow people expressing e.g.
Yes, but DST <-> standard time switches will almost always have to be handled in a special way, as AFAIK almost all public transport timetables either use headways (both explicitly as part of the published timetable, or implicitly from an operations perspective) or at least recurring wall clock times. My opinion phrased in a more general way:
I propose to:
cc @juliuste |
I don't know how today in GTFS the zone which applies a daylight saving is identified. Each agency carries a timezone attributes to identify which zone it uses in GTFS data. |
Unfortunately, the terms "time(zone) offset" and "time zone" are not used very precisely; The Time zone and List of time zones Wikipedia articles are good examples of this. But from my experience, modern technical systems have settled on time zone identifiers as defined by the tz database. Its time zone definitions include all relevant information when and how shifts occur. The GTFS Timezone field type uses tz identifiers:
|
Thank you for taking the time to consider this topic in detail. Backwards compatible changesRegarding the suggestions you've proposed:
Agreed -- this would slightly improve the clarity of the spec.
Agreed, as this is necessary in order to express those times.
Ideally, I'd love to have a heuristic that consumers can use to filter out redundant runs. But I'm not sure what definition we could use. For instance if we had this situation:
Then 1 and 2 would be mapped onto the same time on the date DST begins. What if trip 2 instead started at 23:16? It wouldn't change the real-world conclusion but would also be different algorithmically. I feel we'd need a quite extensive definition of duplication to solve this. What do you think?
Agreed. On top of these, I'd like to add a few suggestions as well.
This section would include a small example showing cases where the reference point is not midnight, similar to the section we already have for clarifying the effect of block_id. It would probably include 'Table 1' from my initial message on this issue.
This would cover midnight-3am on the date DST begins and the date DST ends, and I think could help make matters less confusing. I propose to open a PR next week to add suggestions 1, 2, 4, 5, 6 to the spec. I don't think we can do much more to improve the situation in a backwards compatible way. Perhaps we could consider adding additional fields relating to behaviour in DST, but I haven't come up with anything yet. |
Suggestion for resolving the point 3.: "On service day where DST begins, GTFS consumers MAY remove trips starting before 01:00:00 that are assigned to the same What do you all think? |
This hard-codes the time offset by which the DST shifts; I'm not sure if it always is 1h, and I strongly prefer using a definition that doesn't rely on it being 1h. Same for the time when the DST shift occurs. Also, as the GTFS spec have more complex rules over time if two stop times are identical (I'm thinking about GTFS-Flex, GTFS-RT, etc.), we should try to find a phrasing that doesn't have to be adapted to them. What do you think about the following definition? I have put the timezone-related part in brackets, because we might want to discuss such phrasing in #322/#328. "GTFS consumers MAY remove each trip on the service date where the DST begins after the DST shift, if there is an equivalent (same I just noticed that we should clarify what happens to other entities referencing the removed stop times, e.g. GTFS-RT |
I have a different interpretation: If there were two buses (of the same |
I've revised the wording based on your suggestions:
(Alternate wordings are in brackets)
Currently the static specification doesn't seem to mention GTFS-RT at all, so I'm wondering where would be the best place to add that info about StopTimeUpdates. ExamplesOften in North America, agencies will provide relatively frequent service, without using clock-face scheduling. Montreal (route 51) When DST starts, the 23:58 and 00:55 trips would end up superimposed. Kelowna (route 8): When DST starts the last two trips would conflict. |
In GTFS, specifying trip schedules during the transition into and out of daylight savings time is complex.
Background
Given the definition of time provided in the specification,
Applying this rule to the date DST begins (March 13, 2022 in my region) and the date it ends (Nov 6, 2022), we obtain the following chart:
Table 1
This has some unusual implications, which I am not certain are understood in the same way by all data producers and consumers.
It is impossible to express the time "Nov 6 00:00" as part of the Nov 6 service day, unless negative hours are used. The specification never clearly defines or prohibits this practice.
Consider a shuttle that runs once an hour on :15 past the hour, every day of the week. One could use this very simple schedule for the entire year:
But this would actually create two duplicative trips on "Mar 12 23:15". When DST ends, it would skip the "Nov 6 00:15" run. Unfortunately, I've rarely encountered producers creating special services for the DST transition days.
Questions
Potential changes
To reduce confusion, the specification could state that all trips during the DST transition (e.g.
00:00-03:00 Mar 13
this year in my timezone) shall be ignored. Producers would be required to use times between24:00-27:00 Mar 12
instead. However, this is just a starting point for discussion and I hope that we can collaborate to find a good solution to this problem as a community.The text was updated successfully, but these errors were encountered: