4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Valhalla | docker imageをbuildし、日本全域の地図を読み込む

Last updated at Posted at 2022-05-31

はじめに

ValhallaはOpenStreetMapを元にしたルーティングエンジンです。公式のdocker imageがあるのですが、ドキュメントが不足しており初見ではどう使うのかなかなか分かりづらい状態です。試行錯誤した結果、build方法などが分かりましたので共有したいと思います。

Dockerfile

例として日本全域の地図データを読み込んでいます。必要に応じて適宜変更してください。

FROM valhalla/valhalla:run-latest

WORKDIR /app
RUN wget http://download.geofabrik.de/asia/japan-latest.osm.pbf
RUN mkdir -p valhalla_tiles
RUN valhalla_build_config --mjolnir-tile-dir ${PWD}/valhalla_tiles --mjolnir-tile-extract ${PWD}/valhalla_tiles.tar --mjolnir-timezone ${PWD}/valhalla_tiles/timezones.sqlite --mjolnir-admin ${PWD}/valhalla_tiles/admins.sqlite > valhalla.json
RUN valhalla_build_tiles -c valhalla.json japan-latest.osm.pbf
RUN valhalla_build_extract -c valhalla.json -v

EXPOSE 8002

CMD ["valhalla_service", "valhalla.json", "1"]
4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?