Don't turn around on a ferry link

Right now, you can easily make GraphHopper turning around on a ferry. This usually doesn’t work in real life.

Link to the screenshot example.

Expected behavior

Follow the Ferry to the end and use the ferry (or any other road) to return back.

I don’t really have a good idea to prevent this. My first idea was to preprocess every ferry and virtually duplicate the way and create two edges that are tagged as oneways. Then we need to make sure that we use the same edge when placing a waypoint on a ferry. That is not really feasible though.

I’m not sure what the use case is here, because when the user creates the via point without address search then (s)he could either move to via point off the ferry or add a second point at the end - I’m not sure if we should be too smart for any use case. (And isn’t this possible with pass_through=true?)

I tried pass_through=true and at least in this case it didn’t work. I guess the pass_through penalty in this case is just too small?

Yes, I fully agree. This is certainly no high priority case. IMHO calculated routes should be legal and possible. In this case it might be legal, but not really possible. I don’t have a good idea on how to catch this other than using a mechanism like pass_through if the initially snapped edge is a ferry or something like that.

Maybe a via point on a ferry route does not make sense in general and snap_prevention=ferry should be the default.

Ah, yes. The default one might be too small, yes.

At least I like to place waypoints on ferries to force that I use a certain ferry if this is part of my planned travel. But that probably highly depends on the use case :+1:

Powered by Discourse