Adding a profile changes matched route


I am running Graphhopper with the Docker image provided here GitHub - IsraelHikingMap/graphhopper-docker-image-push: Scripts to create and upload a docker image of graphhopper

I start by using the config-example.yml file provided, so I only have a car profile, and I get a certain result when matching a given gpx file, which seems good to me.

I then just do the same with a custom config.yml, which is an exact copy of config-example.yml, except I add a new bike profile, in its most simple form, I then have in my profiles:

    - name: car
      vehicle: car
      weighting: fastest
    - name: bike
      vehicle: bike
      weighting: fastest

I also add this profile to profiles_ch:

    - profile: car
  #   - profile: car_with_turn_costs
    - profile: bike

And then when I try to match the same gpx with the same profile (car), the output is different: it now avoids what was nearly a U-turn.

I don’t understand why adding a new profile changes the output of the other profile. Am i missing something?

Thanks a lot for your help.

When you add the bike profile some roads might be included that would not be included if you only used the car profile (those that cars are not allowed to drive on anyway). I think this can change the result in certain cases. Can you be more specific how the output changed? And maybe share your request so we can reproduce this?

I suppose it’s because profile with enabled turn costs has more priority (in case if under the hood both profiles has the same vehicle) and overrides flag encoder settings. but it’s only my suggestion.

No, I don’t think so. @alexfortoul said only a bike profile was added: bike+car gave different results than just car. And even if we had two car profiles, one with and one without turn costs, that would not really change anything. It’s true that in this case the (and there is only one) car flag encoder will include turn costs, but the profile without turn costs will/should still behave as if the other profile wasn’t there.

1 Like

Thanks for your help.

Here are screenshots of the output, the red line is just my initial GPX, and the green one if the mapped route.

With only a car profile:

When adding a bike profile as previously mentioned:

And here is the GPX file I used:

Created GPX: <?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns="" xmlns:xsi="" xsi:schemaLocation="" version="1.1" creator=" --">
      <trkpt lat="48.86400042111182" lon="2.3607843371469666">
      <trkpt lat="48.86400042111182" lon="2.3607843371469666">
      <trkpt lat="48.86355691455583" lon="2.3547411840491885">
      <trkpt lat="48.86073482698218" lon="2.3530194642553046">
      <trkpt lat="48.862741253038955" lon="2.335490834124835">
      <trkpt lat="48.86689310416586" lon="2.323124376331279">
      <trkpt lat="48.86671810266022" lon="2.323062929002894">

The pbf needed if France / Ile-de-France:

Thanks again!

Ok and which GraphHopper version is this? Did you try this without Docker yet?

Sorry for the late reply.
I have not tried without Docker yet, and it is the latest image available - seems to be version 6.0.

Ok, but version 6 does not even exist :smiley:

It seems to be the latest master: Docker Hub

@alexfortoul Can you try the docker image which is tagged with version 5.1?

Any updates here?

Hey !

I am sorry for the (more than) very late reply - I had to focus on unrelated work, but now I’m back and I tried both the versions tagged 5.1 and 6.0 and I can confirm the problem still exists, if that helps in any way.