marcusyoung / otpr

OpenTripPlanner REST API wrapper for R
Other
31 stars 4 forks source link

Possible to return all itineraries from otp_get_times()? #11

Closed jdsher closed 4 years ago

jdsher commented 4 years ago

As the title suggests, is there a way to retrieve all possible itineraries from the function, instead of the first? I'm imagining a list of dataframes, ideally. The use case is being able to sift for OD pairs that can be reached via transfer, even if it is not the most efficient means.

Many thanks for your work on this package - it's helped my org with a lot of projects already.

marcusyoung commented 4 years ago

@jdsher OTP isn't able to return 'all possible' itineraries, and there's probably no useful way of determining what that might mean. In a big city there could be so many potential itineraries between an OD pair. You can ask OTP how many itineraries you want returned. That's not currently implemented in otpr. I've considered it in the past, but wasn't sure there was a use case, given you can tweak other parameters to influence how OTP selects the 'best' one. If I did implement it then I think the itineraries dataframe would have a row for each returned itinerary, rather than a separate dataframe for each.

For your use case, is a route planner the best option? To find if you can get from O to D other than direct would probably be easier to answer with the GTFS feed in a database and then running a suitable query?