Closed mpadge closed 1 year ago
Madrid has a "transfers.txt" table, as do the Warsaw data used by @stmarcin and discussed in #24. These can - and should - both be used as examples to develop this functionality.
Both cases are interesting as they are different: Madrid's metro timetable is fully covered by frequencies, while in case of Warsaw it affects only part of the feed (one transport mode, i.e. metro).
I have a code that converts frequencies.txt
into stop_times.txt
but it does more things (remove the problem with trips/stop_times which start one day and finish the day after, i.e. departure/arrival hour is 24 or more. I will clean (simply) it and post it here (it works with tidytransit gtfs so no matter how (in)efficient is, it probably would need some tailoring).
hey that's great @stmarcin - it would be even better if you wanted to do it as a PR here. You could initially do it as a stand-alone function, and we could then work towards incorporating it automatically in the gtfs_timetable()
function. With that and the code i just pasted for calculating "transfers.txt"
(#14), the warsaw data would then finally be usable!
Closing because @stmarcin added this functionality via #25 - thanks!
Re-opening this issue to re-implement the entire frequencies-to-stop-times routine in C++. Finally found a feed which is almost entirely based on "frequencies" tables (Santiago, Chile), and the routines from #25 just don't scale at all, so must be done in C++ to be usable at all.
https://multigtfs.readthedocs.io/en/latest/gtfs.html#frequencies-txt-frequency - that's the closest thing i can find for an appropriate reference on the exact relationship between "frequencies.txt" tables and values given in "stop_times.txt":
When trips are defined in frequencies.txt, the trip planner ignores the absolute values of the arrival_time and departure_time fields for those trips in stop_times.txt. Instead, the stop_times table defines the sequence of stops and the time difference between each stop.
closing now in favour of #89
This is currently not processed, but needs to be in cases where it is present.
frequencies.txt
described here