Route near border passes through multiple borders depending on transportation


I tried generating a route between 2 locations in Romania, near the border with Ukraine and Moldova, and the resulting route passes through both neighbouring countries on the way to the destination.

This is the route when Car is selected as the mode of transport:

However, when selecting a different transportation method, like Bike, the route is contained within the Romanian border:

The other transportation options are also inconsistent on whether they cross the border or not.

I have noticed that a similar issue was addressed here, but I don’t know if it is directly related to this.

GraphHopper doesn’t really care about border crossings by default. But you could build a custom model which avoids other countries:

 "priority": [
   "if": "country != ROU",
   "multiply_by": 0.0

I see, so that was the default behaviour. The difference depending on transportation was weird to me so I was not sure.

Thank you for the response!

I think it is mere coincidence that the other transport mode resulted in a route that did not cross the border.

You can examine both routes:

Vanilla bike:

Forced via Romania (+11min):

1 Like
Powered by Discourse