Route over highway takes exit and immediately merges back again

Hi all!

I am responsible for solving an issue in our self-hosted Graphhopper routing engine.
The person who implemented this is unfortunately no longer available for any questions.
Therefore, I am now turning to you to see if you might be able to guide me to a solution.

When creating a route without any avoid parameters (we just want the fastest route) everything seems to work perfectly. There however is a very minor yet annoying issue.

The created route follows the highway (as expected for the fastest route) but prefers to drive through gast stations or other exits to immediately merge back onto the highway again.


It would be nice if this behaviour was consistent but obviously it is not.
Here it would be possible to leave the highway and join right after, but it doesn’t (as I expect everywhere).

I have no clue about where to even start debugging this issue due to the inconsistency of this issue.
Obviously I do not expect a immediate solution from this lovely community but you might be able to point me in the right direction.

The route I used to create the screenshots are from our local server.
It should match this route. The extra coordinates (besides start / end) were added to indicate where the issue occurs.

Maybe that helps in identifying what is wrong with our configuration / engine :wink:

Thanks in advance!

I wanted to add more screenshots / info but that wasn’t allowed as this is a new account.
Most important thing to add is maybe that when I try to recreate the issue on graphhopper maps site, I don’t even get the same result as we get from our server :frowning:

There’s a turn restriction which prevents this:

Google Maps comes to the same result:

If you want the same behaviour on your server, you need to enable turn restrictions:

Interesting! Thanks for the information :slight_smile:

But would that also be the reason why initially the route is sent off the highway to immediately merge back again? As the example in the initial screenshot shows.

Another example is this:

The reasons might be several but sometimes in such cases there were no maxspeed tags on those roads leading to a higher default speed estimate than on the motorway itself. Which GH version are you using? (and a link to GH Maps would be good)

See this related issue. (as discussed there, in the open source version there wasn’t such an issue, but if you have one let us know. And we are working on making our “ETA tunings” open source or better said we work on a cleaner open source reimplementation to replace our closed source legacy :wink: )

You are absolutely amazing! Thanks so much, the issue has been resolved!
I indeed guess that the lack of turn restrictions made the routing engine believe this was just as fast (or even faster) than the actual highway :wink: Just like you suggested!

We are running GH v5.

I cannot express my gratitude enough. Massive thanks! :smiley:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.