Open felixguendling opened 1 year ago
(This is not Google's or MobilityData's position on this, merely my personal interpretation of the spec and the surrounding materials & discussions.)
Some fields in the specification are explicitly specified to be in UTC. For the rest I can assume that they refer to the GTFS-static local times?
Side note: As discussed very recently in https://github.com/google/transit/issues/322, there is a different between agency_timezone
and stop_timezone
.
I would assume that all Time fields in GTFS that can be tied to an agency (e.g. stop_times.*
, frequencies.*
) are "relative to" the timezone specified in agency_timezone
.
- What happens in case the first departure time is greater than
24:00:00
? The start date is the one specified in theservice_id
or the "real" start date (which would be for example on the next day)?
I would expect a TripDescriptor.start_time
to always refer to the service day of the scheduled trip "run" in the corresponding GTFS Schedule dataset.
Let's consider a specific example: If there is a scheduled trip t1
with a first departure of 26:00:01
that runs on service days 20230606
("run" A, effectively starting at 2023-06-07T02:00:01
) and 20230607
("run" A, effectively starting at 2023-06-08T02:00:01
), I would expect a GTFS-RT TripDescriptor
start_date=20230606
and start_time=26:00:01
to match "run" A;start_date=20230607
and start_time=26:00:01
to match "run" B;start_date=20230607
and start_time=02:00:01
not to match anything (and render the TripUpdate
invalid).If my assumptions are right, then technically the TripDestriptor.start_{date,time}
merely describe a local (as in "wall clock time") date+time, as the timezone is only indirectly implied via the GTFS Schedule dataset's agency_timezone
. Therefore, start_{date,time}
are to be treated rather like a foreign key uniquely referencing a single "run" in the GTFS Schedule dataset.
Thank you very much @derhuerst! I think it absolutely makes sense if you interpret start_date
more like a database key (derived from service_id
via calendar_dates.txt
and calendar.txt
entries, no matter if the first departure from stop_times.txt
is greater or smaller than 24:00:00
) and not like a real date identifying the day on which the trip has its first departure (in whatever timezone). It might make sense to add a clarification to the standard and leave the issue open until then?
Hi everyone!
I have a question regarding the
TripDescriptor.start_date
. Currently, the documentation tells me this:https://gtfs.org/realtime/reference/#message-tripdescriptor
Two questions:
start_date
timezone is not directly specified, I assume that it's in the corresponding agency timezone of the trip? Some fields in the specification are explicitly specified to be in UTC. For the rest I can assume that they refer to the GTFS-static local times? (to be translated like the GTFS-static data as described here).24:00:00
? The start date is the one specified in theservice_id
or the "real" start date (which would be for example on the next day)?Example:
calendar_dates.txt
trips.txt
stop_times.txt
Now the first departure time of trip
T_RE2
would be onservice_id
-02:00
I would guess that GTFS-RT is supposed to give me the date from
service_id
(2019-03-31) to refer to the trip. However, both other options would also be reasonable in a way.I have not been able to get this information from the specification. Can someone please clarify how to handle these cases?