Differencing two rasters with very different resolutions (QGIS 3.20.3)

demqgisqgis-3rasterresampling

I am having a problem with analysing two rasters with 2 significantly different resolutions.

Background on the two rasters:

  • DEM is the ALOS_30m DEM which is in the WGS_84 format. Merged together individual tiles to produce a mosaiced DEM across the Canadian Cordillera.
  • The Glacier DEM. These are ice thickness DEMs which are individual glacier rasters (over 15,000) which I first reprojected to WGS_84 (as they are in different projections from WGS_84_UTM_Zone_9N to WGS_84_UTM_Zone_12N depending on their location across the Canadian Cordillera). I then merged hem together. I did all this in a python script as using QGIS to do all of this for individual rasters would have been impossible. Maybe the projection I did could be an issue?

This rasters align over each other perfectly and do not need to be shifted at all, the entire problem is with the cell sizes.

The preprocessing I have done:

I tried two things to see if I could fix my problem (these are with them all in the WGS_84 format):

  • I aligned the two rasters with the Raster > Align Rasters… tool, this is the resampling the glacier DEM to the ALOS DEM, I also used a cubic resampling of the cell values.
  • I re-projected both the ALOS DEM and the glacier DEM to the Lambert Conformal Conic projection (so the cell sizes are in metres), then did the same as the above.

The Problem:

I am working in the Canadian Cordillera and want to different a DEM (ALOS 30m) with a second glacier DEM (~100m) which is over specific areas (i.e. glaciers). This stretches across the entire Canadian Cordillera and so I have them in the same projection system WGS_84.

I have tried it just using WGS_84 (but resolutions are in degrees), and reprojecting them from WGS_84 to Lambert's Conformal Conic (to have the cell sizes in metres). My plan is the minus the glacier DEM with the ALOS DEM. I have resampled the glacier DEM to the same resolution as the ALOS DEM using the Raster > Align Rasters tool (as said above).

When I difference them (DEM – Glacier DEM) and do a hillshade. Across where the glacier DEM does not cover it looks fine, but over where the glacier DEM covers (and thus the difference has been calculated) there is a cross hatching pattern going on (two figures below).

Figure 1: The differenced DEM when they are in the WGS_84 projection, aligned to the ALOS DEM with the same resolution.

Figure 2: Same as the above, but in the Lambert Conformal Conic projection.

First image is the differenced DEM when they are in the WGS_84 projection, aligned to the ALOS DEM with the same resolution. The second figure is the same as the first but with the Lambert Conformal Conic projection.

What I think the problem(s) is:

I am certain that the problem is the different resolutions. 30m with 100m probably do not work because 100m is not a multiple of 30m which may be messing up the resampling. And so when they are resampled, the pixels are overlapping each other creating the cross hatching. Thus they need to be aligned with the pixels to not be overlapping.

Another problem may be the projection? As I stated previously the ALOS DEM is WGS_84 while the glacier DEM is made up of over 15,000 glacial specific DEMs which I had to individual retroject to WGS_84 and merge them. This could also have caused a problem?

The solution I want:

For where the glacier is, and thus the different is calculated, to look like the surrounding topography i.e. not cross hatching, as I want to use this for further calculations and figure creation.

Is there a way which I can resample the glacier DEM to 30m, align it with the pixels of he ALOS DEM, and difference them and not have the cross hatching?

Please remember I am working over a large area with a large file size (10GB) and my PC is not the most powerful. I can use Python scripting (but I am only a beginner and am not that good at advanced scripts).

MORE INFORMATION

I have conducted a further analysis and have found out that it is something to do with the merge I am doing. When I retroject them and use them on their own (singular glacier outline), their is no cross hatching (after doing the resampling with cubic and raster differencing etc.). When I have merged a few of them, then I get the cross hatching. I do not know why.

Best Answer

Thank you for all your suggestions. I tried them all and I certainly shall be taking all your advice moving forwards.

After trial and error to sort this issue out I had to go back to basics. I reprojected every individual raster to WGS_84. Resampled each raster to the same pixel size as the DEM. Merged it all and it sorted the issue out.

Seems like a really simple issue which I should have figured out quickly. Shall leave this up incase anyone else has a similar issue.