3次元のテライン (3D Terrain)(書きかけ)

概要

Cesium Terrain Builder を用いて、GeoTIFF から 3D 地形タイル(Terrain)を作成する手順を示す(書きかけ)。

キーワード: gdal, GeoTIFF, 3D Terrain, Windows

目次

関連する外部ページ

Cesium Terrain Builder の GitHub ページ

前準備

Cesium Terrain Builder は、GDAL を利用して GeoTIFF などのラスタデータから地形タイルを作成する C++ 製のツールである。公式にサポートされる環境は Linux であり、Windows については Visual Studio でのビルド報告がある。

このツールが出力する地形タイルは heightmap-1.0 形式である。CesiumJS が現在標準で使う quantized-mesh-1.0 形式のタイルを作る場合は、その形式に対応した派生版(例:ahuarte47/cesium-terrain-builder、Docker イメージ tumgis/ctb-quantized-mesh)を使う。

Cesium Terrain Builder のビルドと実行

  1. ソースコードを https://github.com/geo-data/cesium-terrain-builder/releases からダウンロードし、展開する。
  2. Windows のコマンドプロンプトを開く。
  3. ダウンロードしたファイルを展開したディレクトリに移動する。

    実行例

    d:
    cd d:\Downloads
    cd cesium-terrain-builder-0.4.1
    *(⚠️ link removed: this download link couldn't be verified — ask me to re-send this file)*
  4. cmake .」を実行する(cmake のあとに「.」)。

    実行結果の表示で、GDAL と libz が OSGeo4W のものになっていることを確認する。異なる場合は、cmake の実行時に GDAL_LIBRARY_DIR、GDAL_LIBRARY、GDAL_INCLUDE_DIR を指定する。

    cmake .
    *(⚠️ link removed: this download link couldn't be verified — ask me to re-send this file)*
  5. Cesium Terrain Builder.sln」というファイルができるので開く。
    *(⚠️ link removed: this download link couldn't be verified — ask me to re-send this file)*
  6. Visual Studio の画面が開くので確認する。
    *(⚠️ link removed: this download link couldn't be verified — ask me to re-send this file)*
  7. 「ビルド」→「ソリューションのビルド」と操作する。
  8. 出来上がったファイルを確認する。
    *(⚠️ link removed: this download link couldn't be verified — ask me to re-send this file)*
  9. 出来上がったファイルを、PATH(実行ファイルの検索パス)の通ったディレクトリにコピーする。
  10. (オプション)出来上がったファイルを ZIP ファイル *(⚠️ link removed: this download link couldn't be verified — ask me to re-send this file)* でバックアップする。ctb.zip *(⚠️ link removed: this download link couldn't be verified — ask me to re-send this file)* からダウンロードできる。
  11. GeoTIFF ファイルを ctb-tile で処理する。入力は標高値を持つラスタデータとする。
    ctb-tile.exe --output-dir . cea.tif
  12. 地形タイルのディレクトリができるので確認する。
  13. (オプション)出来上がったタイルを ZIP ファイル *(⚠️ link removed: this download link couldn't be verified — ask me to re-send this file)* でバックアップする。terrain.zip *(⚠️ link removed: this download link couldn't be verified — ask me to re-send this file)* からダウンロードできる。