| Forum | GitHub | Maps | Blog

How to use properties file from Routing? [] is not equal to loaded [fastest|car]


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


For “Routing”:

./ -a import -i



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 [] is not equal to loaded [fastest|car]
     at com.graphhopper.GraphHopper.load(
     at com.graphhopper.matching.MatchCommand.<init>(
     at com.example.gpstrack.Map.onConnected(

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:



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


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


Any feedback?


You need to make sure that you are using the same configuration for e.g.


I mean there is no problem using two different folders: one for MapMatching and another one for Routing, with their own properties file it works fine

But I want to use only one folder, because files like “edge”, “geometry”, “location_index”, “names”, “nodes” are the same, only properties differs

Many phones don’t have a lot of storage memory


You can change the properties file to your needs. This is the “configuration file”.


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


As noted above:

When both graphs are created with the same properties you can use them for routing and map matching.


Well what does same configuration/properties mean? How to implement it, any examples?

What I did:

  1. downloaded osm.pbf file
  2. convert it with ./ -a import map.osm.pbf
  3. convert it with java -jar matching-web/target/graphhopper-map-matching-web-*.jar import map.osm.pbf
  4. now I have two folders, one works for Routing and another one works for MapMatching


I also have this problem, have you solved this problem ?