UrbanAnalyst / gtfsrouter

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

Feature Request: Multiple possible routes per trip #96

Open zamirD123 opened 1 year ago

zamirD123 commented 1 year ago

Hey everyone, thanks again for this awesome package!

There are usually 2-3 different alternatives to the same route when you plan a trip on Google Maps or some other public transit routing app/service. However, gtfs_route() only gives you one route per trip.

Does anyone know how these apps do that? Is there a way to implement it with the 'CSA' process behind the scenes?

mpadge commented 1 year ago

The bad news: Nope, there is no way of calculating that at the moment. The good news: That's only because that information is discarded before returning the single best route. It's all generated along the way, so i guess could be retained and returned with the result.

The main gtfs_route algorithm will soon be re-written (#71), and won't use the CSA algorithm anymore. That'll make it even easier to implement something like this. But before that happens: Did you have a particular use case in mind? It is likely to be a reasonable amount of work to implement this. I'd be potentially interested in doing it to help interesting research questions; less so if the aim was just to generate multiple choices for individual routing queries. So I'd definitely first be interested to hear what your use case might be? Thanks for asking!

zamirD123 commented 1 year ago

Thank you, Mark, for your reply!

This is indeed part of a research: I'm part of an academic research group and we're interested in examining how well different people are able to switch from driving to public transportation on a daily basis. The supply of public transport services is not the only factor, but it also has to do with the match between the needs of the individual. We were planning to calculate several public transit alternatives for each car-based trip that we have in our data (trips are defined as a triplet (start_location,end_location, start_time)).

On Wed, Feb 1, 2023 at 2:09 PM mark padgham @.***> wrote:

The bad news: Nope, there is no way of calculating that at the moment. The good news: That's only because that information is discarded before returning the single best route. It's all generated along the way, so i guess could be retained and returned with the result.

The main gtfs_route algorithm will soon be re-written (#71 https://github.com/ATFutures/gtfs-router/issues/71), and won't use the CSA algorithm anymore. That'll make it even easier to implement something like this. But before that happens: Did you have a particular use case in mind? It is likely to be a reasonable amount of work to implement this. I'd be potentially interested in doing it to help interesting research questions; less so if the aim was just to generate multiple choices for individual routing queries. So I'd definitely first be interested to hear what your use case might be? Thanks for asking!

— Reply to this email directly, view it on GitHub https://github.com/ATFutures/gtfs-router/issues/96#issuecomment-1411955821, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQUJ2BA6HKUT75Q2KA77OGTWVJHABANCNFSM6AAAAAAUMX7D4E . You are receiving this because you authored the thread.Message ID: @.***>