ITSLeeds / UK2GTFS

Convert UK transport data (TransXchange / ATOC CIF) to GTFS format in R
https://itsleeds.github.io/UK2GTFS/
GNU General Public License v3.0
37 stars 13 forks source link

ATOC should use Public/GBTT and not Scheduled/WTT times #34

Closed stupidpupil closed 3 years ago

stupidpupil commented 3 years ago

I think it should do so by default, at least.

Relevant bit of the Rail Delivery Group specification:

5.4.13 Journey planners must display the public times in all passenger enquiries. In most case the scheduled and public times will be identical, or will be rounded up/down by ½ minute. However, there are instances where the discrepancy between the two will be several minutes. In such cases it is the public times that should be displayed, and used to calculate minimum connection times for changing trains.

I'm assuming, perhaps incorrectly, that this reflects the main uses of UK2GTFS output. Might be worth having a choice between scheduled and public?

Discovered this issue by looking at a journey between Whitland and Cardigan, where my planner thought someone could make a change at Carmarthen but others didn't. OpenTrainTimes shows the difference in scheduled vs public arrival times at Carmarthen. (There might also be differences in walk-speed and walking paths behind this as well, but the extra minute is probably enough.)

(GBTT = Great British Timetable, WTT = Working Timetable. I did not know this!)

stupidpupil commented 3 years ago

Had a go at this here: https://github.com/stupidpupil/UK2GTFS/commit/af1d8546c832e758523b5cfd11d81bac05f54988

Will test a bit before I submit a pull request.

mem48 commented 3 years ago

Ah, so this goes back to the very early days of UK2GTFS when the main use case is whatever I was doing at the time. As I remember the issue was that the GBTT field was sometimes missing and the WTT was always complete. So it is not a simple as just switching as some extra error handling code is required.

There are some interesting edge cases of untimetabled trains which would be excluded from the GBTT version. So I supposed it does depend on your use case.

Your prosed fix looks good, but test with a few files first.

mem48 commented 3 years ago

@stupidpupil I've committed some fixes to the CI which should make checking pull requests easier. Do you think your fixes are ready for pull requests? They seem sensible to me so I'd love to get them integrated with the main branch if possible.

stupidpupil commented 3 years ago

Think they're working fine, have opened a PR.

mem48 commented 3 years ago

PR merged