Custom Model uses not allowed turn

here’s my configuration:
graph.flag_encoders: car|turn_costs=true

profiles:
  - name: car
    vehicle: car
  turn_costs: true
  weighting: fastest
  - name: car100
    vehicle: car
  turn_costs: true
  weighting: custom
  custom_model_file: car100.yml

this is the configuration of car100.yml

max_speed: {
  road_class: {
    motorway: 100,
  trunk: 100,
  primary: 90,
  secondary: 90,
  tertiary: 90
  }
}
distance_influence: 7

using profile car following correct route is generated:
car

using profile car100 following route is generated:
this route is not correct, as the sharp left turn is nott allowed
car100

What do i have to change in my configuration, that profile car100 generates a correct route?

The indentation in your profile definition looks a bit off? turn_costs etc. should be on the same level as name and vehicle. But I don’t know why car is working and car100 is not. Can you try changing the weighting for car100 to fastest (make it identical to the car profile)? Does it work then? What does your request look like?

Hi,
yes you’re right, i posted a wrong indentation.
In my configuration-file it’s correct.
configuration car100

if i set the weighting of the profile “car100” to “fastest”,
isn’t this profile then indentical to profile “car”?
I thought using “custom_model_file” is only possible when using “custom” for weighting.
Anyway, i tried it.
Now a correct route is generated.
But now my model-file is not used any more.

This is my request:
http://192.168.1.15:8989/maps/?point=46.764266%2C14.384086&point=46.761826%2C14.383206&locale=de&elevation=false&profile=car100&use_miles=false&layer=OpenStreetMap

Yes this was my point I was just wondering if something else does not work. But if you get the right route when you set it to ‘fastest’ this really means that the turn restrictions are violated when you set it to ‘custom’.

Can you try changing your custom model file? What happens when it is empty?

Yes

if the model-file is empty, i get an exception:

Ok yes your model file is already quite small so probably this is not the problem. Can you paste your entire config.yml file here?

here it is
austria.yml.txt (10.4 KB)

i just added another extension, that i can upload it.

Hm, this looks fine. Maybe you changed to turn_costs: true after you ran the import? Can you delete/rename the graph-cache folder and run the import again?

This seems to be a bug. -> https://github.com/graphhopper/graphhopper/issues/2176

1 Like

I fixed this here: https://github.com/graphhopper/graphhopper/commit/90d6fd853bd50ec4fcd47d831fa49c00497f7c23

3 Likes

I never thought, to find a bug during my first tests.

As i did not setup my ide for graphhopper yet:
When will this bug-fix released and can be downloaded at https://graphhopper.com/public/releases/?

I just released GH 2.2 including the fix. You can find the release here: https://github.com/graphhopper/graphhopper/releases/tag/2.2

1 Like

Works perfect!

Thank you very much!

Powered by Discourse