AGDev
June 19, 2024, 8:38am
1
{
"points": [
[
12.57840,
48.85840
],
[
12.56120,
48.90560
]
],
"snap_preventions": [
"motorway",
"ferry",
"tunnel"
],
"details": [
"road_class",
"surface"
],
"profile": "car",
"locale": "en",
"instructions": true,
"calc_points": true,
"points_encoded": false
}
Im wondering why the route changed. It was shorter like just 7km straight through the city, not its using the highway 12km.
easbar
June 19, 2024, 8:57am
2
When is the last time you remember the shorter 7km long route was chosen? It still appears as alternative: GraphHopper Maps | Route Planner
AGDev
June 19, 2024, 9:18am
3
@easbar must be as least the 11th of september last year.
easbar
June 19, 2024, 7:39pm
4
Generally, this can be due to changes in OSM data or data modelling on our side. Is there a specific reason why you’d prefer one route over the other and are there more cases of this kind?
easbar
June 19, 2024, 7:44pm
5
Not sure if this is related but for some reason Google does not allow branching off B8 to the right: https://maps.app.goo.gl/jaCEjiDwazBGHmjE7 . Apparently it assumes this is a one way road (indicated by a little arrow on the map), even though according to street view it is not: https://maps.app.goo.gl/ZZ1rdWuJ9Nf1LhYa8
AGDev
June 20, 2024, 8:32am
6
I would prefer this route because its shorter, while taking just a bit more time. Would consider this as the more efficient route.
I saw the difference in google as well, but this must be a mistake.
easbar
June 20, 2024, 9:07am
7
You can set a preference for shorter routes using the distance_influence
parameter like here
The corresponding POST request would look like this:
{
"points": [
[
12.57840,
48.85840
],
[
12.56120,
48.90560
]
],
"snap_preventions": [
"motorway",
"ferry",
"tunnel"
],
"details": [
"road_class",
"surface"
],
"profile": "car",
"locale": "en",
"instructions": true,
"calc_points": true,
"points_encoded": false,
"ch.disable": true,
"custom_model": {
"distance_influence": 30
}
}
However, this requires disabling CH which affects the response time.