Cannot run map matching example

graphhopper’s map matching example is to first build the graphhopper web jar, and then call this command:

java -jar web/target/graphhopper-web-3.0-SNAPSHOT.jar server config.yml

this fails with the obvious java.io.FileNotFoundException: File config.yml not found which is correct, there is no file of that name, at least at the base of the repo.

i substituted config-example.yml since that file does exist but that also results in an error:

java.lang.IllegalStateException: Couldn't load from existing folder: graph-cache but also cannot use file for DataReader as it wasn't specified!

                at com.graphhopper.GraphHopper.importOSM(GraphHopper.java:643)
                ...

this seems like it may have an obvious fix (no graphs cached yet, load a new graph or something instead), but, i have never used Graphhopper before and don’t know where to begin looking for a solution.

You need to specify the osm pbf, see the installation instruction here:

Will update the map matching docs to point to these lines.

thanks for clarifying. i gave it a shot, and i was able to boot up a server instance.

i tried submitting the test query, but got an error:

$ curl -XPOST -H "Content-Type: application/gpx+xml" -d @web/src/test/resources/test1.gpx "localhost:8989/match?vehicle=car&type=json"
{
  "message": "Sequence is broken for submitted track at time step 0. observation:Observation{point=51.377719,12.338217,0.0}, 0 candidates: []. If a match is expected consider increasing max_visited_nodes.",
  "hints": [
    {
      "message": "Sequence is broken for submitted track at time step 0. observation:Observation{point=51.377719,12.338217,0.0}, 0 candidates: []. If a match is expected consider increasing max_visited_nodes.",
      "details": "java.lang.IllegalArgumentException"
    }
  ]
}

the same error occurs when using the “Choose file” button on the map matching UI.

btw, the error message is clear; i’ll review modifying the configuration of max_visited_nodes and see if i can get it to match on my end.

i forgot to mention, i reviewed the error, and went looking for max_visited_nodes in the example config. i found that the value is not set. the comment suggests that this will then lead to the default value which is Integer.MAX_VALUE. So, I’m not sure the error message I am getting is the real reason that no match is found.

Powered by Discourse