Repository navigation
introduce POST /navigate that accepts GraphHopper request - #3136
Conversation
| } | ||
| } | ||
|
|
||
| // "speed":[24.7, 24.7, 24.7, 24.7, 24.7, 24.7, 24.7, 24.7, 24.7], |
There was a problem hiding this comment.
I have issues testing this. Using config-example.yml and adding max_speed to graph.encoded_values I don't get annotations on links where OSM does have a max_speed set . (Using the GET variant of the request
curl -XGET 'http://localhost:8989/navigate/directions/v5/gh/car/9.010086,48.539837;9.019499,48.535342?alternatives=true&annotations=closure%2Cmaxspeed&geometries=polyline6&language=en&overview=full&roundabout_exits=true&steps=true&voice_instructions=true&voice_units=imperial&banner_instructions=true&details=max_speed'
And OSM import crashes if I set max_speed_calculator.enabled: true. Seems like it needs some encoded values ?
There was a problem hiding this comment.
I haven't had time to actually test the PR, but you would need to use POST requests to request details from GraphHopper as far as I understand it?
That said, now that we have the annotations in the MapboxResponse, we could add the paramter for these in the GET request as well, that should allow to use the get request you show above.
There was a problem hiding this comment.
Yes, currently I set the max_speed path detail only for the POST endpoint:
request.setPathDetails(List.of(INTERSECTION, MaxSpeed.KEY, DISTANCE, TIME, AVERAGE_SPEED));
but it is a good idea to consider the annotations parameter of the GET endpoint too.
And OSM import crashes if I set max_speed_calculator.enabled: true.
Will check this later.
There was a problem hiding this comment.
And OSM import crashes if I set max_speed_calculator.enabled: true
You do not need to enable this. You just need to add max_speed to the encoded value. And yes, if you enable this you got a strange error message but I fixed this 2ba136e. I.e. you needed to additionally enable urban density calculation via e.g. graph.urban_density.threads: 1.
I have issues testing this
I'll try to to test this with the Maplibre SDK.
Do you know if the Maplibre SDK example app will show the maxspeed automatically if we return this info?
There was a problem hiding this comment.
I'll try to to test this with the Maplibre SDK and e.g. enable this for the GET request too.
I just tried it and it seems that the maplibre demo app does no longer require the GET request and this POST request works already, but the maxspeed is not shown in the UI. But this is probably just a limitation of the demo app as in ferrostar this works also in the demo app.
I also found a bug - at least in the demo app: maplibre/maplibre-navigation-android#151
This PR makes it possible to request a mapbox/osrm compatible response format using a graphhopper request.
/cc @boldtrn @OlafFlebbeBosch