graphhopper / map-matching

The map matching functionality is now located in the main repository https://github.com/graphhopper/graphhopper#map-matching
https://www.graphhopper.com/open-source/
Apache License 2.0
785 stars 273 forks source link

How to use properties file from Routing? graph.ch.weightings: [] is not equal to loaded [fastest|car] #139

Closed anonym24 closed 5 years ago

anonym24 commented 5 years ago

There are some differences between OSM files for "Map Matching" and "Routing"

"Map Matching" doesn't work with files of Routing

For "Map Matching":

java -jar matching-web/target/graphhopper-map-matching-web-.jar import .osm.pbf

image

For "Routing":

./graphhopper.sh -a import -i

image

image

So there are some differences in proporties file

When I use properties file form Routing for MapMathing I get the next error:

 java.lang.IllegalStateException: Configured graph.ch.weightings: [] is not equal to loaded [fastest|car]
     at com.graphhopper.storage.GraphHopperStorage.loadExisting(GraphHopperStorage.java:254)
     at com.graphhopper.GraphHopper.load(GraphHopper.java:781)
     at com.graphhopper.matching.MatchCommand.<init>(MatchCommand.java:45)
     at com.example.gpstrack.Map.onConnected(Map.java:811)

In my app I want to use routing and map matching at the same time and use the same files

It seems I need two instance of Graphhopper anyway:

    graphHopperRouting.load("*/graphhopper/country-gh");

    graphHopperMapMatching.getCHFactoryDecorator().setEnabled(false);
    graphHopperMapMatching.load(("*/graphhopper/country-gh");

But how to init the same files? If could init different proporties files, something like this:

image

But I believe default constructor of Graphhopper class won't allow such manipulations, it expects path to the folder

karussell commented 5 years ago

Please use our forum for usage questions.

Update: cross posted

anonym24 commented 5 years ago

@karussell I guess it isn't just a question, it can be considered as an issue or even feature request