3次元のテライン (3D Terrain)(書きかけ)
【概要】
Cesium Terrain Builder を用いて、GeoTIFF から 3D 地形タイル(Terrain)を作成する手順を示す(書きかけ)。
キーワード: gdal, GeoTIFF, 3D Terrain, Windows
【目次】
【関連する外部ページ】
前準備
- Visual Studio C++ をインストール済みであること。
- CMake をインストール済みであること。
- OSGeo4W のインストールを済ませておくこと(GDAL 2.0.0 以上とその開発用ヘッダファイルが必要)。
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 のビルドと実行
- ソースコードを https://github.com/geo-data/cesium-terrain-builder/releases からダウンロードし、展開する。
- Windows のコマンドプロンプトを開く。
- ダウンロードしたファイルを展開したディレクトリに移動する。
実行例
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)* - 「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)* - 「Cesium Terrain Builder.sln」というファイルができるので開く。
*(⚠️ link removed: this download link couldn't be verified — ask me to re-send this file)*
- Visual Studio の画面が開くので確認する。
*(⚠️ link removed: this download link couldn't be verified — ask me to re-send this file)*
- 「ビルド」→「ソリューションのビルド」と操作する。
- 出来上がったファイルを確認する。
*(⚠️ link removed: this download link couldn't be verified — ask me to re-send this file)*
- 出来上がったファイルを、PATH(実行ファイルの検索パス)の通ったディレクトリにコピーする。
- (オプション)出来上がったファイルを 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)* からダウンロードできる。
- GeoTIFF ファイルを ctb-tile で処理する。入力は標高値を持つラスタデータとする。
ctb-tile.exe --output-dir . cea.tif - 地形タイルのディレクトリができるので確認する。
- (オプション)出来上がったタイルを 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)* からダウンロードできる。