Unexpected behaviour of navigate endpoint

Hi Graphhopper Team,

I am using the navigate endpoint to get driving direction to use with the Mapbox SDK.
I saw an unexpected beahviour in this query:
http://localhost:8989/navigate/directions/v5/gh/fastest/15.4805824,46.9185026;15.4630814,46.981762?access_token=dummy&alternatives=false&geometries=polyline6&steps=true&bearings=200,10;&language=de&roundabout_exits=true&voice_instructions=true&banner_instructions=true&voice_units=metric

My goal was to enforce the routing to one direction using bearings and I expected that a route is provided in which multiple left or right turns are provided to go back to the destination, that lays in the opposite direction.

What I got is anyway a uturn as first manuever. Moreover the information about the uturn is not passed to the user in form of a banner or voice information (see attached file).

i tried to pass other parameter accepted by Mapbox V5 (like avoid_manouver_radius) but i see no changes in the results.

Graphhopper version: 7.0 Release run locally
Profile: fastest with turn cost=true and uturn cost =360
Query sent through Postman

Am I missing something?
If I try the same with the route endpoint (of course changing the parameters to use the right one) I get the expected behaviour.

Thanks in advance,

Ale

I think this is a bug which could be also present for the Routing API - can you send the request you used for the Routing API? Please create an issue at Github.

Hi Karussel,

thanks for the fast answer, here is the query using the route endpoint:
http://localhost:8989/route?point=46.9185026%2C15.4805824&point=46.981762%2C15.4630814&profile=fastest&heading=200

I realised that also with the route endpoint the first manuver is an u-turn, so the behaviour of the navigate endpoint and route endpoint is the same, sorry for my mistake.

I still have two questions:

  1. Why with the navigate endpoint the u-turn information is not passed in the voice and banner instructions?
    2)Is there a way to enforce not doing an u-turn as fist manouver? I tried using pass_through, heading penality and uturn cost as high as 1000 but it does not seem to make any effect.

I did an extra check passing an intermidiate waypoint (here the queries
navigate: http://localhost:8989/navigate/directions/v5/gh/fastest/15.4805824,46.9185026;15.478517,46.916597;15.4630814,46.981762?access_token=dummy&alternatives=false&geometries=polyline6&steps=true&bearings=200,10;;&language=de&roundabout_exits=true&voice_instructions=true&banner_instructions=true&voice_units=metric
route: http://localhost:8989/route?point=46.9185026%2C15.4805824&point=46.916597%2C15.478517&point=46.981762%2C15.4630814&profile=fastest&heading=200&heading_penality=1000&pass_through=true)

an I observed that in this case the u-turn at the intermidiate point is correctly avoided, so it seems something is strange if the u-turn is in the first manouver.

Thanks in advance,

Ale

P.S: should I post it anyway as issue to Github?

If the heading is 200 (pointing south-west) why would you expect the first instruction should be a U-turn?

But still I think we do not support the U-turn instruction as first instruction e.g. for

/route?point=46.92071%2C15.482472&point=46.920424%2C15.482622&profile=car&heading=0&ch.disable=true

I.e. although heading says “go north” the route starts with “go south” and no U-turn instruction is shown.

I was expecting that the route goes south and at the first occasion (left or right side road), the route continues to a side road to go north withouth an u-turn as I penalised u-turns with an extreme cost (uturn_cost =1000), as in the example in the screenshot (note: i used a waypoint to demonstarte the route that I was expecting)

If U-turns are not supported as first instruction, I can understand why it happens.
In my opinion I think anyway that the routing should avoid u-turn as first instruction as they do not make lot of sense and are not feasible for most road vehicles.