LoginSignup
13
11

More than 5 years have passed since last update.

OpenStreetMapのベクターレンダリングサーバをお手軽に立ち上げたい

Posted at

前置き

OpenStreetMapのサーバ環境を構築する際、バージョン依存などキツくてつらい。
Ubuntuのversionが異なったり、middlewareのversion依存が多すぎて構築途中で挫折した。
調べるとdocker経由で簡単に構築できる方法があったので手順メモ。

元記事

前提

構築に利用したのは Ubuntu 12.04
Linux ubuntu 3.13.0-85-generic #129~precise1-Ubuntu

1. dockerのinstall

とりあえずdockerをinstall.

2. 対象のエリアの地図データをDL

DownloadImage一覧から、tokyoをDL

curl -O https://osm2vectortiles-downloads.os.zhdk.cloud.switch.ch/v1.0/extracts/tokyo.mbtiles
cp tokyo.mbtiles /var/www

mbtilesの実体は、SqliteDBのファイルなのでこれを読み込むことで簡単に地図データのDBが構築できる。

3. docker imageの実行

あとはdocker runするだけ。

docker run -v $(pwd):/var/www -p 8081:80 klokantech/tileserver-php

表示確認

下記アドレスにアクセスすると地図表示できる

tileserver.png

タイルアクセス

tokyoをDLした場合。下記のようなアドレスでアクセスが可能

13
11
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
13
11