8
8

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 3 years have passed since last update.

gdalツールで画像をGeoTiffに変換してみる。

Last updated at Posted at 2020-06-15

GeoTiffは位置情報を埋め込んだ画像ファイル。GISツールで開くと地図上に任意の画像を重ね合わせることができる。gdal ツールを使って、任意の画像フォーマットからGeoTiffを生成してみる。

gdal_translate

任意の画像から GeoTiff フォーマット画像を生成するには gdal_translate を使う。

一番簡単に生成するオプションは以下の通り。

% gdal_translate -of "GTiff" -a_ullr [画像左上のX座標] [画像左上のY座標] [画像右下のX座標] [画像右下のY座標] [入力ファイル] [出力ファイル]

例えば、以下のページの画像をローカルに保存し、

ゴニョゴニョと gdal_translate にオプションを指定。

$ gdal_translate -of "GTiff" -a_ullr 15466969.20119360 5902003.38968361 16292581.57870004 5024790.2385830 dounai-map1.png output.tif

これで生成された output.tif ファイルを、QGISのラスタレイヤーに読み込んでみる。

背景に OpenStreetMap も指定。こんな地図が出来上がる。

スクリーンショット 2020-06-15 21.30.59.png

GeoTiffに変換するのに選ぶ画像次第で、個性的な地図なども作ることができそうだ。

8
8
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
8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?