Skip to content

Valhalla offline

Jaak Laineste edited this page Nov 30, 2017 · 4 revisions

Valhalla routing packages

Valhalla routing packages are stored as MBTiles-like SQLite files with special .vtiles extension. Individual tiles are stored in tiles table using zoom levels 0, 1 and 2 as used by Valhalla routing engine.

The following sections describe how to create the packages from OSM data.

Install Valhalla tile generator

  • Clone Valhalla Mjolnir project. Note that SDK uses a specific version of Valhalla routing engine, so the checked out version should have the same major version number.
  • Check and modify scripts/dependencies.sh, some apt-get packages may need to be changed depending on Linux distro
  • Clone OSM-Binary project inside mjolnir directory
  • Clone Valhalla conf project
  • After that run scripts/install.sh
  • Modify the configuration in conf/valhalla.json, check tile_dir and other paths.
  • Binaries for building tiles are under .libs folder: execute .libs/valhalla_build_tiles -c conf/valhalla.json PATH_TO_OSM_FILE

Making offline tile packages

Prerequisites:

  • packages.json containing 'tile_mask' fields
  • Valhalla tiles for the planet
  • Valhalla-specific scripts from mobile-sdk-server repository.

Step 1 (build .vtile packages):

  • python valhallaall.py /path/to/packages.json /path/to/valhalla/tiles /output/path
  • Note: output folder must exist beforehand

Step 2 (create new packages.json from map packages containing correct metainfo):

  • cp /path/to/packages.json /path/to/valhalla/packages.json
  • python syncpackages.py /path/to/valhalla/packages.json /output/path valhalla
  • Note: the URLs to the packages must be modified manually, these still refer to original map packages after this step.
Clone this wiki locally