Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration of multiple transport modes into one route #404

Open
thomasroordaGiG opened this issue Mar 1, 2024 · 5 comments
Open

Integration of multiple transport modes into one route #404

thomasroordaGiG opened this issue Mar 1, 2024 · 5 comments

Comments

@thomasroordaGiG
Copy link

thomasroordaGiG commented Mar 1, 2024

Building upon the great tutorial found here, I'm facing an issue calculating travel times in Amsterdam, see screenshot below. The issue arises with travel times from the people in the northern part of Amsterdam, above the river 't IJ above the central station. The shortest route down south by bike and the route that most people will take, is by taking their bikes on the ferry and then continuing by bike. However, it seems that the current solution is not able to handle this situation and routes them via the nearest bridge, drastically increasing their travel times.

As far as I'm aware its's currently not possible to force the routing via the ferry and afterwards continuing by bike. I realize that integration of multiple transport modes into one route is computationally expensive, but maybe there is some utility in using a part of OSM's API, which does use the ferry in these cases. Anyhow, I am not much an expert on this and this might be a very foolish suggestion.
This specific case will probably not apply to many cities around the world, but similar cases might be more abundant, such biking towards and from train stations.

Unfortunately it seems that this issue renders this wonderful solution not practically viable for us at the moment, unless I'm overlooking something (which I hope I am).

bikedistance_IJ

@RidwanTiamiyu
Copy link

Hi. Are you able to combine bicycle and bus?

@thomasroordaGiG
Copy link
Author

Hi. Are you able to combine bicycle and bus?

Thanks for your reply. I'm not really sure how the function combines the two modes of transport when I set it to public transit?

@christophfink
Copy link
Member

Hi! Sorry for the slow reply. I’ve just started a new function in a new University and haven’t found much time to dedicate to r5py.

The way R5 combines different modes of transport is, it searches for the optimum connection with any one mode (i.e., it combines the modes in an OR operation). You can, however, use the access and egress modes to explicitly chain different modes into one trip, e.g., using cycling as access and egress mode, and cycling OR public transport for the main transport mode.

@RidwanTiamiyu
Copy link

Oh, thanks a lot guys.
However, I still get a key error when combining transit with other modes.

detailed_itineraries_computer = r5py.DetailedItinerariesComputer(
transport_network,
origins=origins,
destinations=destinations,
departure=datetime.datetime(2024, 2, 5, 10, 30),
transport_modes=[ r5py.TransportMode.WALK, r5py.TransportMode.TRANSIT],
access_modes=[r5py.TransportMode.CAR], # Add CAR_PARK here
egress_modes=[r5py.TransportMode.CAR], # Typically, walking from transit stops to the final destination
snap_to_network=True,
)
travel_details = detailed_itineraries_computer.compute_travel_details()

@christophfink
Copy link
Member

Oh, thanks a lot guys. However, I still get a key error when combining transit with other modes.

detailed_itineraries_computer = r5py.DetailedItinerariesComputer( transport_network, origins=origins, destinations=destinations, departure=datetime.datetime(2024, 2, 5, 10, 30), transport_modes=[ r5py.TransportMode.WALK, r5py.TransportMode.TRANSIT], access_modes=[r5py.TransportMode.CAR], # Add CAR_PARK here egress_modes=[r5py.TransportMode.CAR], # Typically, walking from transit stops to the final destination snap_to_network=True, ) travel_details = detailed_itineraries_computer.compute_travel_details()

@RidwanTiamiyu : Can you share which error you get?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants