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:
I understand, but how to make one universal properties file which will work for MapMatching and for Routing at the same time, what can I change to make it work for both APIs?
Or I just can dynamically copy proporties files to that folder
For e.g. when App starts it copies first properties file to *gh folder (where “edge”, “geometry”, “location_index”, “names”, “nodes” are placed) and loads one instance of GraphHopper for Routing
after that app deletes that properties file, copies another properties file to *gh folder and loads another instance of GraphHopper for MapMatching
no, GraphHopper’s “load” method expects path to folder, so the only way is to use the next crutch:
Dynamically copy properties files to that folder:
For e.g. when App starts it copies first properties file to *gh folder (where “edge”, “geometry”, “location_index”, “names”, “nodes” are placed) and loads one instance of GraphHopper for Routing
after that app deletes that properties file, copies another properties file to *gh folder and loads another instance of GraphHopper for MapMatching