Change priority based on turn preference

I just implemented it for the latest version :slight_smile:

To use this branch you need the following in the config (see the config-example.yml for a complete example):

graphhopper:
  ...
  graph.encoded_values: orientation
  profiles:
    - name: car
      vehicle: car
      turn_costs: true
      weighting: custom
      custom_model: # specify some custom model, the specific one here is just an example
        distance_influence: 70

In GH Maps you use the (current) custom model:

{
 "turn_costs": {
    "straight": 1,
    "left": 1,
    "right": 1,
    "min_left_angle": 17,
    "max_left_angle": 180,
    "min_right_angle": -17,
    "max_right_angle": -180
 }
}

But you have to press Ctrl+Enter as the Search button won’t be enabled as the custom model is seen as invalid.

The turn detection is now done differently via an orientation change (and has certainly its problems) but in general this simple method works better and previously failing tests are now passing.

Still this is not yet production ready because it is unclear to me how to make the modeling more realistic, e.g. where the road_class and changes regarding road_class are also considered. Also regarding performance it is currently suboptimal that we have to use the getEdgeIteratorState.

The best would be to have access to the encoded values of the previous edge in the priority and speed section too but this was hard to achieve in the code and might be expensive regarding performance too.