gtfsrouter icon indicating copy to clipboard operation
gtfsrouter copied to clipboard

frequencies.txt

Open mpadge opened this issue 6 years ago • 6 comments

This is currently not processed, but needs to be in cases where it is present. frequencies.txt described here

mpadge avatar Mar 11 '19 10:03 mpadge

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.

mpadge avatar Apr 17 '20 14:04 mpadge

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).

stmarcin avatar Apr 17 '20 14:04 stmarcin

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!

mpadge avatar Apr 17 '20 14:04 mpadge

Closing because @stmarcin added this functionality via #25 - thanks!

mpadge avatar Jun 03 '20 14:06 mpadge

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.

mpadge avatar Jun 28 '22 19:06 mpadge

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.

mpadge avatar Jun 30 '22 12:06 mpadge

closing now in favour of #89

mpadge avatar Jan 02 '23 17:01 mpadge