GeoTIFFを読み込めない

17 visualizaciones (últimos 30 días)
Yu
Yu el 30 de Sept. de 2021
Comentada: Yu el 12 de Oct. de 2021
こんにちは。
GeoTIFFを読み込み、地図を表示させたいのですが、エラーになってしまいます。
どうしたらよいでしょうか?
[A,R] = readgeoraster("Dynamic Surface.tif");
mapshow(A,R)

Respuesta aceptada

Kojiro Saito
Kojiro Saito el 30 de Sept. de 2021
GeoTIFF画像の座標系が地理座標系か投影座標系で使う表示用の関数が変わります。
readgeorasterの第2出力(R)がMapCellsReferenceとかMapPostingsReferenceという投影座標系ではmapshowを使います。
例えばドキュメントの例にあるboston.tifは投影座標系の画像です。
[A,R] = readgeoraster('boston.tif');
whos R
Name Size Bytes Class Attributes R 1x1 16888 map.rasterref.MapCellsReference
mapshow(A,R)
一方でRが GeographicCellsReferenceGeographicPostingsReferenceの場合はgeoshowで可視化できます。
[A2,R2] = readgeoraster('n39_w106_3arc_v2.dt1','OutputType','double');
whos R2
Name Size Bytes Class Attributes R2 1x1 1848 map.rasterref.GeographicPostingsReference
latlim = R2.LatitudeLimits;
lonlim = R2.LongitudeLimits;
figure
usamap(latlim,lonlim)
geoshow(A2,R2,'DisplayType','surface')
demcmap(A2)
mapshowで出ているエラーから推測すると、お使いのデータの座標系(R)がMap**の投影座標系になっていないと思われます。
Geographic**の座標系になっていたら、geoshowをお使いになってはいかがでしょうか。
  11 comentarios
Kojiro Saito
Kojiro Saito el 11 de Oct. de 2021
添付ありがとうございます。
A(:, :, 4)は0か255の2値になっていて、ピクセルの輝度値が画像の領域内なら255、領域外なら0になっているだけでしたね。
A(:, :, 1:3)の色情報を緯度、経度にマッピングするには不要の情報でした。
[A, R] = readgeoraster("Sample.tif");
p = R.ProjectedCRS;
[x,y] = worldGrid(R);
[lat,lon] = projinv(p,x,y);
geoshow(lat,lon, A(:,:,1:3))
geoshowの中に緯度経度座標に投影したAの色情報(1:3)だけ入れればできました。
Yu
Yu el 12 de Oct. de 2021
なるほど、輝度値というのがあるのですね。勉強になりました。
こちらでも、元のデータで無事緯度経度に変換できました。
何度も丁寧にお答えいただき大変助かりました!ありがとうございました。

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!