traveltime-dev / traveltime-python-sdk

TravelTime SDK for Python programming language
https://docs.traveltime.com/
MIT License
20 stars 5 forks source link

Computing isochrone for public transport #25

Closed noel-schneider closed 1 year ago

noel-schneider commented 1 year ago

Hi! I am trying to display an isochrone of 80 minutes, based on public transport. For public transport, it looks like we need to specify if those 80 minutes are done exclusively by public transport or with some walking.

The parameters I am playing with are travel_time and transportation.walking_time. For a total of 80 minutes, I tried:

travel_time=50 and transportation.walking_time=15 travel_time=60 and transportation.walking_time=10 travel_time=70 and transportation.walking_time=5

Here are the results:

50 + 2*15: Aartselaar_1_50

60 + 2*10: Aartselaar_1_60

70 + 2*5: Aartselaar_1_70

As you can see, they are very different, and I would like a combination of all of them, to include every possibility. Is there a way to indicate only 80 as a parameter, and the API consider "every" possibility?

chris-traveltime commented 1 year ago

Hi Noel, thanks for reaching out!

It's probably worth me explaining how the walking_time and travel_time parameters work together, as this may answer your question.

The travel_time is just the total allowed time for the entire journey, including any walking parts.

The walking_time parameter is the maximum time allowed for walking at the start and end of the journey. In other words, from the origin to the first stop/station and then from the final stop/station to the destination. The value is applied independently at both ends, so 5 minutes would allow 5 minutes walking at the start and the end.

Any walking legs in the middle of the route (i.e between changes of public transport) are capped at 10 minutes regardless of the walking_time parameter.

So in your example of wanting an 80 minute journey with different amounts of walking_time, you should still set the travel_time as 80, rather than taking away 2x the walking time.

If you do this, the isochrones will get larger as you increase the walking_time, because more options will become available, but others won't become unavailable. So if you wanted a 'combined' area of all possibilities, you should simply set the walking_time value to as large as possible (although it can't be greater than the travel_time itself).

Hope this helps!