GraphHopper.com | Forum | GitHub | Maps | Blog

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


#1

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

./graphhopper.sh -a import -i germany.osm.pbf
./graphhopper.sh -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(GraphHopper.java:725)

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?


#2

GraphHopper can only load one storage at a time: https://github.com/graphhopper/graphhopper/issues/293

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