Search code examples
dockerosrm

unable to build an osrm docker server for Brazil


I am trying to build my own docker server for Brazil. To do that I'm following this example. First I run this line of code:

docker pull osrm/osrm-backend

Then I download Brazil data from Geofabrik:

wget http://download.geofabrik.de/south-america/brazil-latest.osm.pbf

Pre-process the extract with the car profile:

docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/brazil-latest.osm.pbf

But when I run the line of code above I only get one file which is the timestamps when I should get a lot more. However, when I run all commands for Berlin or Ireland (like in the example), I can successfully build my own server, I'm not sure why the same steps are not working for Brazil.

To build Berlin the following lines of code should be run:

docker pull osrm/osrm-backend
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-extract -p /opt/car.lua /data/berlin-latest.osm.pbf
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-partition /data/berlin-latest.osrm
docker run -t -v "${PWD}:/data" osrm/osrm-backend osrm-customize /data/berlin-latest.osrm
docker run -t -i -p 5000:5000 -v "${PWD}:/data" osrm/osrm-backend osrm-routed --algorithm mld /data/berlin-latest.osrm

I tried to follow that code (but with brazil-latest.osm.pbf and brazil-latest.osrm respectively), but I'm unable to extract all files from brazil-latest.osm.pbf. I'm not sure if there is a problem with Brazil or if there is something I am doing wrong.


Solution

  • Without knowing your system, it sounds like the classic problem that you don't have enough memory. https://github.com/Project-OSRM/osrm-backend/wiki/Disk-and-Memory-Requirements
    Also have a look at https://github.com/Project-OSRM/osrm-backend/issues/5265 there is a good discussion.

    If that is your problem and you are running Linux consider using a swapfile for local extraction since they removed stxxl support in 5.23.0 (https://github.com/Project-OSRM/osrm-backend/pull/5760).
    If you don't need the whole country you could also extract a smaller bounding box with tools like for example osmosis.