How to convert 3d array to raster (tiff)
Afficher commentaires plus anciens
Dear all,
I have a 3 dimension array (longitude*latidute*time) (1439*719*1512) which represents the value of precipitation for 0.25 * 0.25 degrees over the whole globe.
I want to have a raster file (tiff) for time=1. how to do it?
whos lon lat t precipitation
Name Size Bytes Class Attributes
lat 1x719 2880 double
lon 1x1419 5760 double
precipitation 1439x719x1512 12515017536 double
t 1512x1 12096 double
3 commentaires
Walter Roberson
le 12 Oct 2019
If you want a raster file for time=1, then do I understand correctly that the task is to convert the lat/long referenced information precipitation(:,:,1) into a raster form?
BN
le 12 Oct 2019
Réponse acceptée
Plus de réponses (2)
Sulaymon Eshkabilov
le 11 Oct 2019
1 vote
Image Analyst
le 12 Oct 2019
If "m" is your 3-D variable, then do this
time1 = m(:, :, 1);
imshow(time1, []);
This assumes your latitude and longitudes are uniformly spaced. If they're not, then you'll have to convert each into a row and column that is linear and assign the values one pixel at a time with the corrected (linear) latitude or longitude.
3 commentaires
BN
le 12 Oct 2019
Walter Roberson
le 12 Oct 2019
surf(lon, lat, precip(:,:,1).'); view(2)
BN
le 12 Oct 2019
Catégories
En savoir plus sur Data Import and Export dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!