how to convert a netcdf file into a tiff/geotiff file
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
i want to convert netcdf files to geotiff in matlab.any idea on how to go about it.
0 commentaires
Réponses (2)
Reyadh Albarakat
le 7 Mai 2018
I recommend you to use "geotiffwrite". https://www.mathworks.com/help/map/ref/geotiffwrite.html.
3 commentaires
Reyadh Albarakat
le 8 Mai 2018
Dear;
I wrote this code for you. Please try it!
%
OutFolder = 'Your Outputs Path';
cd Your Data Path
dinfo = dir('*.nc');
nfile = length(dinfo);
filenames = {dinfo.name};
for k = 1:nfile
file_name{k} = filenames{k};
lat = ncread(file_name{i},'lat') ;
lon = ncread(file_name{i},'lon') ;
A{k} = ncread(file_name{k},'MYD08_D3_6_AOD_550_Dark_Target_Deep_Blue_Combined_Mean');
A{k} = (double(A{k}));
R = georasterref('RasterSize',size(A{k}),'LatitudeLimits',[min(lat),max(lat)],'LongitudeLimits',[min(lon),max(lon)]);
tiffile{k} = strcat(filenames{k},'.tif') ;
geotiffwrite(fullfile(OutFolder,tiffile{k}),A{k},R);
end
Voir également
Catégories
En savoir plus sur NetCDF dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!