UrbanAnalyst / gtfsrouter

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

Using gtfs_traveltimes for many-to-many calculations #115

Closed FlxPo closed 5 months ago

FlxPo commented 5 months ago

I need to compute a lot of origin - destination travel times between stops. Would it be possible to compute many-to-many travel times, in addition to one-to-all travel times ? gtfs_route does this but it is much slower and i do not need the detailed itinirary.

For now I wrote a custom gtfs_traveltimes_parallel that calls gtfs_traveltimes, for a list of stop ids. It sped up many-to-all calculations, but there is still a lot of wasted calculations, because I am filtering the destinations afterwards to reduce the results to many-to-many.

mpadge commented 5 months ago

Yep, but it's not here, it's https://github.com/UrbanAnalyst/m4ra/blob/main/R/gtfs.R. Let me know if you've got any questions about using that

mpadge commented 5 months ago

Or pkgdown page at https://urbananalyst.github.io/m4ra/reference/m4ra_gtfs_traveltimes.html

FlxPo commented 5 months ago

OK thanks, but this function is still many-to-all within a given time limit, right ?

mpadge commented 5 months ago

Yes, it's always many-to-all, because a single scan has to consider all possible connections in order to find any desired ones anyway, so there is no way to create a more efficient many-to-many rather than simply many-to-all.

FlxPo commented 5 months ago

OK good to know. One of the reasons of my slow requests seem to be the problem with max_traveltimes mentioned in https://github.com/UrbanAnalyst/gtfsrouter/issues/116. Hopefully I can stick to many-to-all calculations if I find what's wrong.

mpadge commented 5 months ago

Great, I'll close this issue now then, but feel free to ask any further questions.