Adding a profile changes matched route

Hi,

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:

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

I also add this profile to profiles_ch:

  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="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" version="1.1" creator="gpx.py -- https://github.com/tkrajina/gpxpy">
  <trk>
    <trkseg>
      <trkpt lat="48.86400042111182" lon="2.3607843371469666">
      </trkpt>
      <trkpt lat="48.86400042111182" lon="2.3607843371469666">
      </trkpt>
      <trkpt lat="48.86355691455583" lon="2.3547411840491885">
      </trkpt>
      <trkpt lat="48.86073482698218" lon="2.3530194642553046">
      </trkpt>
      <trkpt lat="48.862741253038955" lon="2.335490834124835">
      </trkpt>
      <trkpt lat="48.86689310416586" lon="2.323124376331279">
      </trkpt>
      <trkpt lat="48.86671810266022" lon="2.323062929002894">
      </trkpt>
    </trkseg>
  </trk>
</gpx>

The pbf needed if France / Ile-de-France: http://download.geofabrik.de/europe/france/ile-de-france-latest.osm.pbf

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?

Powered by Discourse