Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ワークショップハンズオンのモデルストーリー #6

Closed
hfu opened this issue Oct 11, 2018 · 1 comment
Closed

ワークショップハンズオンのモデルストーリー #6

hfu opened this issue Oct 11, 2018 · 1 comment

Comments

@hfu
Copy link
Member

hfu commented Oct 11, 2018

ワークショップハンズオン のモデルストーリーを詳細化し、具体的なハンズオンの内容を煮詰めていきたいと思います。第一案、次のとおりです。

モデルストーリー骨子

OSM データと独自データを混ぜ合わせて基本図ベクトルタイルサービスを作ります。このモデルストーリーでは、空間的領域はスリランカに限定し、とりわけ大縮尺については完全に OSM データに依存し、小縮尺では(通常 OSM 系のベクトルタイルサービスでは Natural Earth を使うところ)地球地図スリランカを使用して、統合的な基本図ウェブ地図サービスを作ります。

ソースデータを入手・整形し、地物ストリームを処理しながら設計属性を付与し、tippecanoe で mbtiles に変換し、ベクトルタイルサーバ spinel でローカルホストにホストをし、ローカルホストに設置した maputnik でスタイル付けを行う。その後、HTTPS, SPDY 又は HTTP/2 サーバで運用をする、というのがモデルストーリーになります。このうち、最初段階と最終段階を除いた段階について、3時間の枠内でハンズオンしていきます。

モデルストーリー

(1) ソースデータの入手・下処理(説明のみ)

OSM

普通の planet.osm.pbf を入手します。国連ベクトルタイルツールキットでは z=6 のモジュールごとに処理するのが標準なので、そのための下処理として、osmium extract で planet をモジュール分割します。実際には、planet.osm.pbf のダウンロードや osmium extract の実行には半日から数日のオーダーの時間がかかるので、実際のハンズオンでは、このパートについては説明のみにとどめ、下処理済みの ndjson ファイルをハンズオンイントラのサーバから入手してもらう形にします。

地球地図

地球地図アーカイブからスリランカの地球地図を入手します。実際のハンズオンでは、このパートについても説明のみのにとどめ、下処理済みの ndjson ファイルをハンズオンイントラのサーバから入手してもらう形にします。

ハンズオンで必要なソフトウェア:ウェブブラウザ。curl があるとなおよい。

(2) 地物ストリームを処理しながら設計属性を付与

地物の一つ一つに、カスタマイズ可能な自動処理によって、ベクトルタイルレイヤ名、最小ズーム、最大ズームといった設計属性を付与し、不要な属性を取り外すというい処理を行います。具体的には、国連ベクトルタイルツールキットで定式化されている modify.js の様式に沿って、簡単な if then ベースの JavaScript ファイルを作っていただき、簡単なコマンド実行(cat osm-6-45-30.ndjson | node remodify.js > 6-45-30.ndjson、といったものになるでしょう。)をしてもらいます。

必要ソフトウェア:node, テキストエディタ

(3) tippecanoe で mbtiles ファイルに変換

tippecanoe コマンドを使って、ndjson ファイルを mbtiles ファイルに変換します。コマンドラインパラメータの使い方を少しお伝えする必要があると考えています。

必要ソフトウェア:tippecanoe

(4) ベクトルタイルサーバ spinel でローカルホストにホスト

HTTP のみを使い、ArcGIS Server Web Service との相互運用のための機能を省略する形に縮退させたベクトルタイルサーバ pietra のサブセットである spinel を使って、mbtiles がローカルホストからサーブされるようにします。

必要ソフトウェア:git, npm, node。動作確認のためにウェブブラウザ。curl があるとなおよい。

(5) ローカルホストに設置した maputnik でスタイル付け

ローカルホストに設置されたベクトルタイルのスタイルは、ローカルホストに設置された maputnik で編集できます。このため、git と npm を使って maputnik をローカルホストで運用します。

spinel には、ベクトルタイルのサイズを円の大きさで可視化する circle-vis のコードを埋め込んだサイトを同梱しておき、ベクトルタイルのサイズを最適化するために調整を行うという、国連ベクトルタイルツールキットが最も重要視する生産作業にも取り組んでもらいます。

必要ソフトウェア:git, npm, node, ウェブブラウザ。

(6) HTTPS, SPDY 又は HTTP/2 サーバで運用(説明のみ)

この後、実際には運用のための作業が必要です。しかし(1)すべての受講者がインターネットサーバを所有していると仮定することは現実的ではない、(2)インターネットサーバがない限りは、HTTPS, SPDY 又は HTTP/2 での運用に必要なサーバ証明書関係の話をするのは中途半端になる、という理由から、この部分については説明に留めます。

@hfu
Copy link
Member Author

hfu commented Nov 5, 2018

英語にも変換してみました。

Get source data and convert them to GeoJSON Text Sequences (prepared and explained)

  • Prepare GeoJSON Text Sequences from planet.osm.pbf for the module 4-46-30.
  • Prepare GeoJSON Text Sequences from Global Map Sri Lanka 2.0.
    These are done beforehand, and the resulting data will be provided to the workshop participants.

Add design properties by processing the GeoJSON Text Sequences (hands-on)

  • Confirm that Node.js and git are ready.
  • Get a UN Vector Tile Toolkit repository for producing vector tiles (spinel-produce).
  • Run a Node.js script to add design properties (minzoom, maxzoom, and layer name) and confirm it works.
  • Share the way to customize the vector tile schema (edit a script named modify.js)

Convert the processed GeoJSON Text Sequences into vector tile packages (hands-on)

  • Confirm that tippecanoe is ready.
  • Run the shell script to run tippecanoe.
  • Share the way to customize parameters for tippecanoe (edit the shell script)

Host the vector tile packages on localhost (hands-on)

  • Get a UN Vector Tile Toolkit repository for a localhost vector tile server (spinel).
  • Copy or move the vector tile package to an appropriate directory.
  • Start the server and confirm your vector tiles are ready.
  • Share the way to host web contents and other tiles (copy data in appropriate directories.)

Style the hosted vector tiles using maputnik hosted on localhost (hands-on)

  • Get maputnik from GitHub and build it using Node.js.
  • Run maputnik along with spinel on localhost.
  • Load the vector tile style on spinel to maputnik. Edit the style and confirm the rendering changes.
  • Share to way to write the edited style back to spinel and on GitHub.

Operate the vector tile service using HTTPS, SPDY, or HTTP/2 server (explained)

  • Set up server certificates. Use of “Let’s Encrypt” is an option.
  • Set up the server appropriately on an Internet or intranet server (possibly using pietra).

Your own customization time, and the question and presentation time (hands-on / discussion)

  • Take your time doing what you are interested in, and then discuss.

@hfu hfu closed this as completed Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant