Response time Endpoint /route vs. /navigation/directions

What makes this significant difference in calculation time when comparing the endpoints /route and /navigation/directions?

Example: graphhopper-web-4.0, germany-latest OSM, standard example config-yml, profile car
Route across Germany: 15 milliseconds vs. 7 seconds

I use and old Mapbox Turn by Turn sdk that uses the navigate/directions endpoint and would need better performance. Any hints?

http://localhost:8989/route?point=47.827908,12.524414&point=53.479329,10.030518&type=json&locale=de-DE&key=&elevation=false&profile=car
13.6 kB
15ms

42kB
7 Seconds
localhost:8989/navigate/directions/v5/gh/car/12.524414,47.827908;10.030518,53.479329?access_token=&alternatives=false&geometries=polyline6&overview=full&steps=true&continue_straight=true&annotations=congestion%2Cdistance&language=en&roundabout_exits=true&voice_instructions=true&banner_instructions=true&voice_units=metric

Currently the navigation endpoint disables CH to easily support turn restrictions (which is much slower for longer routes). The default node-based CH won’t support turn restrictions and so we can’t use it.

Would be a nice addition if we can use CH if it is edge-based (to enforce turn restrictions). Likely we also have to think about how to support the heading for CH but I think @easbar thought this through :slight_smile:

old Mapbox Turn by Turn sdk

btw: have a look into this here: https://github.com/maplibre/maplibre-navigation-android/issues/8

Hm ok that explains it.

Any fast hacks/trade off solutions for long routes to get this thing faster? Does LM Prep help?

Finding the code snippet in the graphhopper web where to turn off turn restrictions to make use of CH is only my last resort :slight_smile:

Yes, enabling LM should definitely help. Or you can contribute a change for the /navigate endpoint where CH is then used in case it supports turn restrictions :slight_smile:

Finding the code snippet in the graphhopper web where to turn off turn restrictions to make use of CH is only my last resort :slight_smile:

What do you mean here?

30 milliseconds with LM instead of CH. I guess i do not care anymore for CH :slight_smile:

Thanks, you saved my day and the next week with an ugly hack i planned to execute to get to the goal.
And you saved me from feeling disgusted by myself after implementing it.

Maybe the information that CH is not used on the /navigate endpoint and LM helps a lot could be more prominently somewhere.
Maybe in the example.yml files that fly around on github.

I guess i am not the only one that fell for this one :slight_smile:

1 Like

Maybe the information that CH is not used on the /navigate endpoint and LM helps a lot could be more prominently somewhere.

The better approach would be IMO to deprecate the /navigate endpoint and offer an example on how to integrate the /route endpoint directly in the maplibre navigation SDK. Then it can be controlled from the client if with or without CH etc.

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