Steps 1
to 7
have been implemented in prototype/scripts/graphhopper/generate-cache.sh
Use the OSM map file of your choice. In this guide we use
indonesia-lastest.osm.pbf
.
- Clone the graphhopper repo from github
git clone [email protected]:graphhopper/graphhopper.git
- Download the
indonesia.osm.pbf
file from geofabric.de to~/.graphhopper/openstreetmap/indonesia-latest.osm.pbf
- cd into the graphhopper folder
- update
web-bundle/pom.xml
:nodeVersion = v.17.2.0
andnpmVersion = 8.0.4
- build the project
mvn clean package
- run
java -Ddw.graphhopper.datareader.file=$HOME/.graphhopper/openstreetmap/indonesia-latest.osm.pbf -Xmx16g -Xms16g -jar web/target/graphhopper-web-*.jar server config-indonesia.yml
- wait until the server started. this may take some time, since it's loading the map and preparing the cache
- if it's too slow, you may need to change the Xmx/Xms settings (set it to an ok number like
12g
or16g
) - the precompiled graphhopper cache will be in
~/.graphhopper/openstreetmap/indonesia-latest.osm-gh
folder
- once the cache is generated, head over to
prototype/scripts/graphhopper
- review the variables in
build-and-upload.sh
file - run it:
./build-and-upload.sh
Note: make sure you're generating the graphhopper cache with the same version of graphhopper as the one you will use in the built docker image.