Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GraphHopper: loading multiple OSM files to self-hosted server

I have set up a local server of GraphHopper for Navigation/Routing on a virtual machine running Ubuntu 15.10 as the Guest OS.

To initialise the server, one needs to specify the following command (in a terminal): java -jar graphhopper-web-0.5.0-with-dep.jar jetty.resourcebase=webapp config=config-example.properties osmreader.osm={osmFileName}.osm.pbf, which I will refer to as the GHServerCommand from here on.

My Question: Can I load multiple OSM files to this server?

I have attempted this in two ways both of which were unsucessful:

Attempt 1:

  • running the GHServerCommand with the first file... until the Server starts running (terminal output: Server started on port 8989
  • running the above command with the second osm file in a new terminal, while the server is already running with the first OSM data set.

Attempt 2:

  • running the GHServerCommand with both files, specifying them in a comma separated format, i.e. :java -jar graphhopper-web-0.5.0-with-dep.jar jetty.resourcebase=webapp config=config-example.properties osmreader.osm={osmFileName1}.osm.pbf,{osmFileName2}.osm.pbf

Seeing that both attempts were unsucessful, I am unsure whether this will work at all. Is there a way to load multiple osm.pbf files to a self-hosted GraphHopper server?

like image 958
bilo-io Avatar asked Nov 26 '15 14:11

bilo-io


1 Answers

GraphHopper currently only supports to import one PBF, although there is no problem to support multiple if they don't overlap. If they would overlap or be adjacency to each other then it will be more complex to implement that.

But you can easily merge two PBFs in both cases:

osmconvert some.osm.pbf --out-o5m | osmconvert - other.osm.pbf -o=merged.pbf

See about the documentation and installation of osmconvert here

like image 105
Karussell Avatar answered Oct 16 '22 16:10

Karussell