| Forum | GitHub | Maps | Blog

How to set routing between two countries? Load two "*-gh" folders


I want to get route between two neighborhood countries, I converted pbf files to grapphopper format:

./ -a import -i germany.osm.pbf
./ -a import -i moldova.osm.pbf

But when I try to load those countries I get next error:

GraphHopper graphHopper = new GraphHopper().forMobile();
graphHopper.load(new File(mOSMData, "germany-gh").getAbsolutePath());
graphHopper.load(new File(mOSMData, "poland-gh").getAbsolutePath());

Caused by: java.lang.IllegalStateException: graph is already successfully loaded
at com.graphhopper.GraphHopper.load(

Is there any solution for that or GraphHopper can work only with one OSM data at the same time and there is no way to connect two countries or two cities if there are different folders?


GraphHopper can only load one storage at a time:

You can merge both PBFs before the import with e.g. osmconvert.