Graphhopper.com not acting the same as new install of graphhopper versioin 9.1 or 10?

First, just want to say great product!

Really excited about release of version 10. However, i can’t seem to get a local install to work like graphhapper.com maps?

Example:

If you take off surface == GRAVEL, it shows shorter route, and if you add || surface==DIRT it prevents the route by saying “Connection between locations not found” which is correct! (Or at least what i am trying to achieve, don’t want a custom model to be able to go on dirt.)

See here:

However, i can not duplicate this with local install of GraphHopper 9.1 or 10. It allows this path with what appears to be a “snap to” maybe? (End of path shows dotted lines onto Dirt road destination, and pulling a semi trailer over cow dung and rattlesnake fields is frowned upon :slight_smile:

I have tried Custom Models, and editing config.yml and changing
routing.snap_preventions_default: tunnel, bridge, ferry, (i have tried adding *rattlesnake, foot stuff, bike stuff, etc, but no luck?).

But seriously, can i see a copy of your config.yml file? (The ones from here don’t seem to have the same result: https://raw.githubusercontent.com/graphhopper/graphhopper/10.x/config-example.yml)

To reproduce, simply install fresh 9.1 or 10.0 with OSM file for KS here:
https://download.geofabrik.de/north-america/us/kansas.html

Use same params in the link and notice this the red dotted lines that takes you to destination instead of “Connection between locations not found”?

Here is custom model from clicking gear box (top left) and enable “custom model active”
{
“distance_influence”: 15,
“priority”: [
{
“if”: “surface==DIRT”,
“multiply_by”: “0”
}
],
“speed”: ,
“areas”: {
“type”: “FeatureCollection”,
“features”:
}
}

Looking at commit here, it looks fine?

I’m sure i am just missing something in snap_preventions maybe? Is there a way maybe to say snaps cannot be over 50 meters?

Thanks for a great product, appreciate any hints i can try.

Thanks!

Update: I tried building from master, but still same problem.

Build from master, download Kansas map, edit config.yml to include surface in the list of graph.encoded_values:

I have noticed it sometimes works (prevents path to destination on dirt), but sometimes, if you specify surface == dirt, set priority to 0, it will end the route on the last gravel road then put dots to the place on the dirt road and say it is reachable?

Since graphhopper.com is doing it correctly (it does not add the dots to the path), i assume i am missing something in the config.yml file, maybe related to “snap to”, not sure.

Here is example from local install:

Any hints would be appreciated. Thanks!

I can confirm that open source GraphHopper snaps onto Shawguee Rd (and indicates the distance between the requested coordinated and the snapped location with a dotted line), while graphhopper.com seems to snap onto the requested Wirt Rd resulting in a connection not found error. But honestly, right now I’m not sure the reason for this. Will have to investigate.

Thank you for taking a look at it.

However, i would like to stress that i think graphhopper.com is the correct answer? (And it is local copy of graphhopper that finds a route when it shouldn’t?)

For example, using this formula from here: graphhopper/docs/core/custom-models.md at master · graphhopper/graphhopper · GitHub
edge_weight = edge_distance / (speed * priority) + edge_distance * distance_influence

I was under the assumption that if a custom model sets “multiply_by” to zero, then a route should not be found? (Making graphhopper.com correct because i am trying to say if destination is on a dirt road, don’t go there at all)

If you look at example custom_model here:

notice that multiply_by: 0 is set for size (height) of truck > 4m . However, i did notice that “distance_influence” is 1, when it should be set to 0 also to prevent a path?

Thanks for all your help.

You did/can not really say the destination is on a dirt road, because GraphHopper only takes the coordinate as an input. Therefore it’s tricky to decide whether your coordinate might have been somewhat imprecise and it is ok to snap to a road a little further away (no connection-not-found error), or if it should blindly snap to the nearest road (the dirt road) (resulting in the connection-not-found error).

Think about a cycleway next to a big highway. It wouldn’t be useful to simply snap to the cycleway and show a connection-not-found error just because the cycleway was closer to the requested coordinate.

But of course this does not answer the real question yet: Why does the local instance act differently?

Had a chance to try a few things.

  1. Did try to use an older OSM file for Kansas, just because… no change.
  2. You are correct, i originally thought it had something to with the setting routing.snap_preventions_default, but that setting is new, and only supports following types

Now, notice two more examples (in same area)

On the GraphHopper server:

Notice, how close the blue pushpin (middle stop) has to be for a connection to exist

On LocalServer, notice how far i can take the same pin away and it finds a route:

It is actually on a a different dirt road now it is so far away… (if you move it much farther away than that, it will fail)

So, if you give me a hint what that blue dotted path would be called in the code, i will be more than happy to take a look? (Seriously though, i’ll keep looking).

Also, If I use Germany OSM, the two maps seem to match about right in the distance allowed, see here:

If you move the farthest North pushpin a little bit more North, it fails the route.

just a quick update, i’ll keep looking

The blue dotted line is nothing but a visual aid. It is only drawn by the web UI but isn’t related to the actual snapping and path calculation.