Giter VIP home page Giter VIP logo

Comments (4)

kevinkreiser avatar kevinkreiser commented on June 1, 2024

interesting, that looks like a bug to me! the way its supposed to work is that this exception is caught on the c++ side and then wrapped by an error json. what seems to be happening is that its not being caught anymore and bubbling all the way up to python. if we can reproduce we can certainly track it down and fix it so that it does the error handling properly.

now to the larger issue about reproducability on your data versus the server. you are right to expect the same results given the same request. if you had exactly the same data then you certainly should get the same results so likely there is some difference in the data. checking the timestamp on the data shows that it is up to date so now i am wondering where the failure could be. on your side we can narrow it down by removing locations until the route succeeds. that will tell us on which leg of the route the failure occurs. would you be able to give that a shot? narrowing it down to where its failing a bit

from valhalla.

thomthom avatar thomthom commented on June 1, 2024

interesting, that looks like a bug to me! the way its supposed to work is that this exception is caught on the c++ side and then wrapped by an error json. what seems to be happening is that its not being caught anymore and bubbling all the way up to python. if we can reproduce we can certainly track it down and fix it so that it does the error handling properly.

Right, I was wondering why the error was a generic RuntimeError and not something more domain specific.


now to the larger issue about reproducability on your data versus the server. you are right to expect the same results given the same request. if you had exactly the same data then you certainly should get the same results so likely there is some difference in the data. checking the timestamp on the data shows that it is up to date so now i am wondering where the failure could be. on your side we can narrow it down by removing locations until the route succeeds. that will tell us on which leg of the route the failure occurs. would you be able to give that a shot? narrowing it down to where its failing a bit

Simplest passing is to remove all via points:

{
  "costing": "motorcycle",
  "costing_options": {
    "motorcycle": {
      "exclude_polygons": [],
      "maneuver_penalty": 5,
      "country_crossing_penalty": 0,
      "country_crossing_cost": 600,
      "width": 1.6,
      "height": 1.9,
      "use_highways": 0.2,
      "use_tolls": 1,
      "use_ferry": 1,
      "ferry_cost": 300,
      "use_living_streets": 0.5,
      "use_tracks": 0.8,
      "private_access_penalty": 450,
      "ignore_closures": false,
      "ignore_restrictions": false,
      "ignore_access": false,
      "closure_factor": 9,
      "service_penalty": 15,
      "service_factor": 1,
      "exclude_unpaved": 0,
      "shortest": false,
      "exclude_cash_only_tolls": false,
      "top_speed": 140,
      "fixed_speed": 0,
      "toll_booth_penalty": 0,
      "toll_booth_cost": 15,
      "gate_penalty": 300,
      "gate_cost": 30,
      "include_hov2": false,
      "include_hov3": false,
      "include_hot": false,
      "disable_hierarchy_pruning": false,
      "use_trails": 1
    }
  },
  "exclude_polygons": [],
  "locations": [
    {
      "lon": 15.433902740478517,
      "lat": 62.73511203446039,
      "type": "break"
    },
    {
      "lon": 14.464616775512697,
      "lat": 61.99614966586813,
      "type": "break"
    }
  ],
  "directions_options": {
    "units": "kilometers"
  },
  "id": "valhalla_directions"
}

I then started to reintroduce them one by one. (I had expected to see it fail on the first via point, but that was not the case)

The second one (that relate to #3 in the Valhalla Demo App) breaks the routing:
bilde

{
  "costing": "motorcycle",
  "costing_options": {
    "motorcycle": {
      "exclude_polygons": [],
      "maneuver_penalty": 5,
      "country_crossing_penalty": 0,
      "country_crossing_cost": 600,
      "width": 1.6,
      "height": 1.9,
      "use_highways": 0.2,
      "use_tolls": 1,
      "use_ferry": 1,
      "ferry_cost": 300,
      "use_living_streets": 0.5,
      "use_tracks": 0.8,
      "private_access_penalty": 450,
      "ignore_closures": false,
      "ignore_restrictions": false,
      "ignore_access": false,
      "closure_factor": 9,
      "service_penalty": 15,
      "service_factor": 1,
      "exclude_unpaved": 0,
      "shortest": false,
      "exclude_cash_only_tolls": false,
      "top_speed": 140,
      "fixed_speed": 0,
      "toll_booth_penalty": 0,
      "toll_booth_cost": 15,
      "gate_penalty": 300,
      "gate_cost": 30,
      "include_hov2": false,
      "include_hov3": false,
      "include_hot": false,
      "disable_hierarchy_pruning": false,
      "use_trails": 1
    }
  },
  "exclude_polygons": [],
  "locations": [
    {
      "lon": 15.433902740478517,
      "lat": 62.73511203446039,
      "type": "break"
    },
    {
      "lon": 15.354852676391603,
      "lat": 62.68182547122809,
      "type": "via"
    },
    {
      "lon": 15.098090171813967,
      "lat": 62.62366757547452,
      "type": "via"
    },
    {
      "lon": 14.464616775512697,
      "lat": 61.99614966586813,
      "type": "break"
    }
  ],
  "directions_options": {
    "units": "kilometers"
  },
  "id": "valhalla_directions"
}

But it's not unique either. If I remove the second via point and replace it with the fourth the routing also breaks.

from valhalla.

thomthom avatar thomthom commented on June 1, 2024

Btw, the data set I used was fetching https://download.geofabrik.de/europe-latest.osm.bz2 on May 10th.

Then I used osmium extract -p nordics.geojson europe-latest.osm.pbf -o nordics-latest.osm.pbf to create a smaller data set.

And then the Valhalla docker image to build the graph:

docker run --rm --name valhalla_gis-ops -p 8002:8002 -v %cd%/custom_files:/custom_files ghcr.io/gis-ops/docker-valhalla/valhalla:latest
osmium fileinfo europe-latest.osm.pbf
File:
  Name: europe-latest.osm.pbf
  Format: PBF
  Compression: none
  Size: 30604860537
Header:
  Bounding boxes:
    (-34.49296,29.635548,46.75348,81.47299)
  With history: no
  Options:
    generator=osmium/1.14.0
    osmosis_replication_base_url=http://download.geofabrik.de/europe-updates
    osmosis_replication_sequence_number=4057
    osmosis_replication_timestamp=2024-05-09T20:21:40Z
    pbf_dense_nodes=true
    pbf_optional_feature_0=Sort.Type_then_ID
    sorting=Type_then_ID
    timestamp=2024-05-09T20:21:40Z
osmium fileinfo nordics-latest.osm.pbf
File:
  Name: nordics-latest.osm.pbf
  Format: PBF
  Compression: none
  Size: 4511998036
Header:
  Bounding boxes:
  With history: no
  Options:
    generator=osmium/1.16.0
    pbf_dense_nodes=true
    pbf_optional_feature_0=Sort.Type_then_ID
    sorting=Type_then_ID

from valhalla.

davidpeck-littlemonkey avatar davidpeck-littlemonkey commented on June 1, 2024

I've found the same error for some car routes in New Zealand that cross the Cook Strait, If both points are far enough from the coast it gives a "No path could be found for input" error:

Failing on both the web examples above and our API server running ghcr.io/valhalla/valhalla:latest with tileset geofabrik: australia-oceania-latest.osm.pbf

from valhalla.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.