public-transport / friendly-public-transport-format

A format for APIs, libraries and datasets containing and working with public transport data.
Creative Commons Attribution Share Alike 4.0 International
125 stars 1 forks source link

delays #6

Closed derhuerst closed 7 years ago

derhuerst commented 7 years ago

How should the delay of a scheduled departure/stopover of a vehicle be specified? Things to consider:

Information we definitely want to express:

The most basic format would probably be to add two fields departureDelay and arrivalDelay, which both contain the number of seconds relative to the scheduled departure/stopover.

derhuerst commented 7 years ago

Because we want people to consume realtime data (if available), it should be the most straightforward to use.

I think it's the best to have a arrival/departure field and a arrivalDelay/departureDelay field containing seconds. Another option might be to have arrival/departure and additionally scheduledArrival/scheduledDeparture containing dates.

derhuerst commented 7 years ago

@juliuste opinions?

derhuerst commented 7 years ago

@juliuste ping.

juliuste commented 7 years ago

I'd slightly prefer the arrivalDelay and departureDelay variant. Vehicles running earlier would get a negative delay then (this is not an argument for or against this method, just another opinion on a question from the post above 😄)

juliuste commented 7 years ago

I'm pretty unexperienced with delay information though, so I'd probably change my mind as soon as someone who knows more about this stuff prefers another variant.

kiliankoe commented 7 years ago

Just fyi, the VVO/DVB uses the realTime and scheduledTime approach for their mobile app's API at least (the others either use just realTime and whatever the default for EFA or TRIAS systems are).

I much prefer having a single timestamp and another timedelta. Especially since two timestamps can be in two different timezones (as in DST values) in edge cases (that was a weird and fun issue to encounter 🙄) making naive consumer implementations rather error-prone.

derhuerst commented 7 years ago

@kiliankoe 👍 Then this is pretty much in line with what we discussed before. I like the arrivalDelay and departureDelay fields as time delta as well. Keep in mind that there's a difference between time deltas between localized DateTimes and those deltas between UNIX timestamps (take the DST as an example).

Also keep in mind, that we already incentivise people to do the date/time calculations correctly by using ISO 8601 strings instead of UNIX timestamps, to make sure information like the timezone don't get lost during processing.

Because we want people to consume realtime data (if available), it should be the most straightforward to use.

I would also like to reemphasise on this: It should be the easiest and intuitive thing to consume realtime data (instead of scheduled data), to make sure naive implementations at least use the most accurate available data.

derhuerst commented 7 years ago

@juliuste @kiliankoe To sum it up: any objections with