How to reproject and resize a raster to match another raster of different resolution and coordinates?
4 views (last 30 days)
I have a first DEM of the area of the area around a glacier in the European Alps, which is in UTM zone 32N (EPSG 32632), and has a spatial resolution of 30 meters (the size is 246x272).
I have a second DEM, which is from ERA-5 Land. It is in geographical lat,lon coordinates (EPSG 4326), is much larger (Europe) and has a spatial resolution of 0.1 x 0.1 degrees (the size is 501x501).
How can I reproject and resize the second DEM, so that the size and the coordinates of both DEM's are the same? In other words: I want to have the second DEM in equal spatial position and resolution as the first one (matrix size 501x501 to 246x272 and spatial match). Is this possible within MATLAB through for example reprojection and interpolation? How can this be done?
I have both geotiffs uploaded at: https://drive.google.com/file/d/1xdahwKfYrTTkXDz-aKw8njEsDIcyIkXz/view?usp=sharing
They can be read in by and info can be obtained with:
DEM = double(geotiffread('DEM_30m.tif'));
DEM2 = double(geotiffread('ERA5-Land.tif'));
info = geotiffinfo('DEM_30m.tif');
[x,y] = pixcenters(info);
info2 = geotiffinfo('ERA5-Land.tif');
[x2,y2] = pixcenters(info2);