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

Support for routes including ferries? #703

Open
FriedCurmudgeon opened this issue Mar 7, 2024 · 6 comments
Open

Support for routes including ferries? #703

FriedCurmudgeon opened this issue Mar 7, 2024 · 6 comments

Comments

@FriedCurmudgeon
Copy link

Hi, thanks for a great addition to Leaflet!
I have stumbled into a wierd issue, the routing machine seems to avoid ferries when calculating routes. How can I fix this?

image

@curtisy1
Copy link
Collaborator

This is... interesting. I'm guessing you're using the L.Routing.OSRM instance?
From a quick test, OSRM itself does not seem to consider this ferry as an option for some reason (it should support ferries from what I know).

What I can say is that GraphHopper and Valhalla both find a ferry but they take different ones (you can play around with it here)

I'll do some digging in overpass and see if I can find out what exactly causes each of those routing engines to consider a different ferry or in OSRM's case, no ferry at all.

My suggestion at the moment would be to use either lrm-graphhopper or lrm-valhalla as a fallback solution.

Also, it would be amazing if you could give me some more information about the ferries, as it's possible that the data OSM has on them is slightly wrong (pedestrian only ferry, limited to vehicles < 1t, etc.) and that could impact the routing engines to the point where they make such drastic changes

@FriedCurmudgeon
Copy link
Author

FriedCurmudgeon commented Mar 11, 2024

Thank you @curtisy1 for replying. I am using the default OSRM instance. I will take a look at one of the other engines.

The ferry is a mixed pedestrian/car ferry betwen Norway and Denmark operated by Colorline. The transfer is about three hours.

@curtisy1
Copy link
Collaborator

The data at Overpass seems to be correct (see here for a simple query). I have no idea what's going on with OSRM or Valhalla there. It might just be an issue on their end with how they calculate the best route.

I know Valhalla internally works with penalties/costs, so maybe there is something that makes the ferry in Larvik better for their algorithm (wild guess: it thinks taking the highway is faster than the ferry). As for OSRM, I don't know how they work internally but not taking the ferry into account is almost certainly a bug.

I'll open up a discussion about it in their respective repos, for now, the only solution seems to be using either Valhalla or GraphHopper

@curtisy1
Copy link
Collaborator

curtisy1 commented Mar 11, 2024

I think this might be what's happening with OSRM and possibly with Valhalla as well, depending on how the nodes/ways are tagged in OSM itself. It looks correct to me but something might be off.

@RoutingAPI
Copy link

This is not a problem of OSRM in general but the public OSRM demo instance you are using. That one has - due to hardware constraints - a reduced functionality in calculating routes via ferries resulting in a lot of ferry routes not being used.

E.g. if you test a route from Kristiansand in Norway to Aalborg in Denmark here: https://fast-routing-api.demo.routingapi.net/ you'll see the ferry being used (and that one is OSRM under the hood as well). But if you use the OSRM demo instance at https://router.project-osrm.org, the ferry line won't be used.

@FriedCurmudgeon
Copy link
Author

Can confirm that this works after switching to Graphhopper.

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