UrbanAnalyst / gtfsrouter

Routing and analysis engine for GTFS (General Transit Feed Specification) data
https://urbananalyst.github.io/gtfsrouter/
81 stars 17 forks source link

frequencies.txt #13

Closed mpadge closed 1 year ago

mpadge commented 5 years ago

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

mpadge commented 4 years 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.

stmarcin commented 4 years ago

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

mpadge commented 4 years ago

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 commented 4 years ago

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

mpadge commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

closing now in favour of #89