CH returning Connection Not Found between points

Hello guys! I have configured my UK map for Motorbike profile with CH using GH 5.0.
I am trying some routes, and with CH is returning me the error Connection Not Found between points, but with the same route and using the parameter CH.disable=true is calculating properly the route.

Is it possible there is a kind of bug in the way how CH in Graphhopper 5.0 works?
Thanks in advance to everybody.

PD: I am going to check if I can reproduce it with GH 4.0.

1 Like

It’s possible there is a bug, sure. Another explanation could be that the CH index data (in the graphhopper folder) does not match your profile. This could happen if you changed the profile without creating the index data from scratch. Can you start a fresh import without any previous data and check if the problem remains? Or describe the exact steps needed to reproduce the problem?

Hi! In my case, I am pretty sure the profile didn’t change. Below I describe the exact setup I am using if it helps. Let me know if you need anything else.

OSM File
https://download.geofabrik.de/europe/great-britain-latest.osm.pbf

config.yml

graphhopper:
  datareader.file: ""
  graph.location: ""
  graph.elevation.provider: "srtm"
  prepare.min_network_size: 700
  prepare.min_one_way_network_size: 700
  routing.non_ch.max_waypoint_distance: 1000000
  graph.bytes_for_flags: 8
  graph.dataaccess: "RAM_STORE"
  graph.encoded_values: "max_height,max_weight,max_width,hazmat,toll,surface,track_type"
  graph.flag_encoders: motorcycle|turn_costs=true

  profiles_ch:
    - profile: custom_motorbike

  profiles:
    - name: custom_motorbike
      vehicle: motorcycle
      turn_costs: true
      u_turn_costs: 0
      weighting: custom
      custom_model_file: custom_motorbike.json

custom_motorbike.json

{
  "speed": [
    {
      "if": "road_class == MOTORWAY",
      "limit_to": 60
    },
    {
      "if": "road_class == MOTORWAY && road_class_link",
      "limit_to": 60
    },
    {
      "if": "road_class == TRUNK",
      "limit_to": 60
    },
    {
      "if": "road_class == TRUNK && road_class_link",
      "limit_to": 60
    },
    {
      "if": "road_class == PRIMARY",
      "limit_to": 23
    },
    {
      "if": "road_class == LIVING_STREET",
      "limit_to": 5
    },
    {
      "else": null,
      "limit_to": 15
    }
  ],
  "priority": [
    {
      "if": "toll == HGV || toll == ALL",
      "multiply_by": 0.0
    },
    {
      "if": "road_environment == FERRY",
      "multiply_by": 0.0
    }
  ],
  "distance_influence": 1200
}

The routes failing are:
Example 1 (origin, destination): 51.49224,-0.13922. ------------- > 51.489871,-0.156003
Example 2 (origin, destination): 51.51185608,-0.0274867 ------> 51.513241,-0.025506

I have tested exact same scenario with GH 4.0, and it works.
Let me know if I can help is something. Thanks in advance.

I tried this with GH 5.0, but I cannot reproduce it: Are these the routes you are talking about?

image

Yep, the routes are those ones.

In my case I have this with CH.disable=false

I am thinking if maybe it is a problem with the OSM data. From where do you get the latest OSM data?
Thanks

I used the link you added to your comment above: https://download.geofabrik.de/europe/great-britain-latest.osm.pbf
Even if this was the problem I wouldn’t understand why it worked for ch.disable=false, but otherwise it does not.

Otherwise it is always a good idea to use time-stamped OSM data when trying to reproduce a problem, i.e. something like https://download.geofabrik.de/europe/great-britain-210101.osm.pbf from here: Geofabrik Download Server

Just to clarify, I have recreated the map again with the last OSM file, and worked as expected.

So probably the last generation of the OSM used to generate the map had a kind of issue for those routes.

Thanks guys for the collaboration

1 Like

hi guys! I’d like to reopen the thread. I want to share steps how to reproduce described issue:

  1. Download graphhopper-web-5.0.jar
  2. Download UK OSM April 18th
  3. Put config.yml, custom_motorbike.json, graphhopper-web-5.0.jar and great-britain-220418.osm.pbf to the same folder
  4. Run map generation and UI:
java -Ddw.graphhopper.datareader.file=great-britain-220418.osm.pbf -jar graphhopper-web-5.0.jar server config.yml
  1. Open localhost:8080/maps and check routes (expect Connection between locations not found for all pairs):
  • 51.49224,-0.13922 → 51.489871,-0.156003
  • 50.722458,-3.533061 → 50.721073,-3.53932
  • 51.511856,-0.027487 → 51.513241,-0.025506
  1. Add ch.disable=true to request URL and check the same routes (expect correct route for all pairs).
1 Like

Ok, I can reproduce this now with your instructions. I’ll investigate. All three routes end behind some kind of gate, probably it is related to this, but I don’t know yet why this happens.

2 Likes

Is there a specific reason you set u_turn_costs: 0? When I set it to 40 or even just 1 instead the problem seems to go away. I opened this ticket for this: Connection not found using CH with u_turn_costs=0 · Issue #2564 · graphhopper/graphhopper · GitHub

1 Like

with such configuration u-turns are enabled and without any penalties. I’ll try increase it a bit

@easbar with u_turn_cost=1 issue has gone. I’m still wondering why it worked with ch.disable=true.

thanks for collaboration and waiting for official bugfix.

This is expected. The reason is simply that the bug that causes the issue only affects the CH algorithm, but not the one that is used when ch.disable=true is set.

By the way: These two properties no longer exist in 5.0:

prepare.min_one_way_network_size: 700
graph.bytes_for_flags: 8

(they do not harm, but they do not do anything either)

I just released a new version 5.1 that includes a fix for this issue.

2 Likes

I still don’t see 5.1 version in any maven repository. @easbar could you check that it was released successfully?

Sorry, there was a problem with the release mechanism. @easbar Shall we tag & release 5.2?

Can we not just re-trigger the build or upload the artifacts manually?

Powered by Discourse