4
votes

in the tutorial it is shown how to start an OSRM server with this example :

wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf

osrm-extract berlin-latest.osm.pbf -p profiles/car.lua
osrm-contract berlin-latest.osrm
osrm-routed berlin-latest.osrm

I would like to start a server not only on Berlin dataset, but on a full country dataset. For instance all German country roads. Maybe there is something to do with the contract, but i don't really know what king of .osrm i should put as argument to tell it to use a larger dataset that would be the combination of several dataset.

I think the answer should be really obvious when we know it, but it still feel a bit wooly.

Thank you.

2
Um, well, just run it on a larger extract? What exactly is the problem? - scai
I mean i would like to use an osrm server on a custom dataset. Like maybe some parts of france, and then some parts of germany etc. Then do I have to download the full Europe extract in order to have some part of some different countries? Or maybe i can just download only the useful datasets and do something like packing together? - DeepProblems

2 Answers

2
votes

According to an OSRM issue it is not possible to merge .osrm files. However you can merge multiple PBF files before generating your .osrm files.

Merging of OSM XML or PBF files can be done with osmium:

osmium merge file1.osm.pbf file2.osm.pbf -o merged.osm.pbf.

Or with osmosis:

osmosis --rb file1.osm.pbf --rb file2.osm.pbf --m --wb merged.osm.pbf

0
votes
wget http://download.geofabrik.de/europe/germany-latest.osm.pbf

osrm-extract germany-latest.osm.pbf -p profiles/car.lua
osrm-contract germany-latest.osrm
osrm-routed germany-latest.osrm

Should work, but please note it will require around 16GB of RAM and probably a similar amount of disk space.

EDIT:

After clarification what you will need to do is merge the .osm.pbf files using the osmium tool.

./osmium merge first.osm.pbf second.osm.pbf third.osm.pbf -o result.osm.pbf