I realised that using the weighting “curvature” and “turn cost true” and switching start and end position in my routing query has a huge difference in the calculation time (sometimes factor up to 20 , i.e. from 350ms to 7000ms) also if the calculated route remains exactly the same but of course inverted.
I am sure that “turn cost true” is causing the difference as I made some tests and turning it off produces the same calculation time.
I am using Graphopper 4.0 on a local server with motorcycle as vehicle and curvature as weightning and turn costs as follows:
- name: motorcycle
I also included graph.flag_encoders: motorcycle|turn_costs=true in the config file.
I am using the LM mode with default settings.
Interestingly that does not always happen, to reproduce it I use Graz (AT) as start and Salzburg (AT) as destination and viceversa. The number of visited nodes also goes from ~ 30000 in one direction to more than 6 millions in the opposite direction.
These strange behaviour does not affect profiles with weighting custom, based on my test.
I imagine this is not the default/expected behavior.
Am I missing some options that I should consider, maybe something like “storeTwoDirections true”?
Do you have the exact steps to reproduce this? (pbf you are using and coordinates for the route)
And can you try with the latest version 6.0?
btw: in master or in future 7.0 there is a curvature feature that can be used in a custom_model, so that you can tweak it to your liking in GH Maps and when you are fine with it move the custom_model to the server-side and enable CH or LM.
I just tried with the 6.2 version and the problem seems gone.
In the 4.0 version I did some (in my eyes) minor modifications to the motorcycleflagencoder.
I will try to add the same modifications in version 6.2 and check if they are the cause of the problem.