Stacking several Geo-tiff into 3d array.

I have several geotiff from different sources, and I cant figure out how to stack the data properly based on georeferences. I'm hoping someone will point me in right direction, especially which function to use.
I have an access to mapping toolbox.

답변 (1개)

Chad Greene
Chad Greene 2014년 10월 13일

1 개 추천

Can you explain the step you're getting hung up on? If all of your images are the same size and resolution with corners pinned in the same places, it may be as simple as
A(:,:,1) = geotiffread('filename1.tif');
A(:,:,2) = geotiffread('filename2.tif');
.
.
.
A(:,:,N) = geotiffread('filenameN.tif');
That could even be done in a loop if you want to stack several images.
If you have multiple images that only partly overlap,, Aslak Grinsted's geotiffreadregion may be helpful. I have written a slightly more user-friendly version of geotiffreadregion with full documentation which I'd be happy to send you if you're interested. A third option, if you know your grid points in map x/y or lat/lon, is to use geotiffinterp.

댓글 수: 2

Justin
Justin 2014년 10월 13일
편집: Justin 2014년 10월 13일
Some geotiffs are sightly rotated and at different zoom level. The data wont align up if I stack them like you suggested. I am looking for a way to assign coordinate for each pixel data then re-project it onto "global map" so I can stack them up and do some spatial analysis.
Hopefully this makes some more sense, since georeferenced data handling is new to me. I'm still learning.
Chad Greene
Chad Greene 2014년 10월 13일
I see. You may be able to load one image, then get the lat/lon of each pixel in that image with pix2latlon, then get values for those those lat/lons for every other image using geotiffinterp.

댓글을 달려면 로그인하십시오.

질문:

2014년 10월 9일

댓글:

2014년 10월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by