2

I’m trying to detrend a DEM in QGIS. The best guidance that I could find on the internet was this question : Removing elevation trend over sloped surfaces?

I couldn’t understand that so I would like to know if someone could explain how to remove the tilt of a DEM. I know that the best approach is to fit a plane and then subtract this from the original DEM. But I can’t understand the criteria to create this plane and how I perform the subtraction. I can use python if needed.

Kajo
  • 691
  • 1
  • 6
  • 11
  • Here is a good explanation of detrending sufaces. https://gis.stackexchange.com/questions/11440/removing-elevation-trend-over-sloped-surfaces/11463#11463 – GBG Aug 30 '19 at 15:11
  • I use the method explained at 10.3 in this document: http://www.bajr.org/BAJRGuides/42_QGIS_StarterGuide/42_BAJR_Guide_QGIS.pdf – nhopton Dec 28 '20 at 12:23
  • Commonly, you fit a first order polynomial to the surface then subtract it. I believe that there is a polynomial regression available in the SAGA module of QGIS but, it probably needs to be points and not a surface. You could convert the results of the point regression to a raster then subtract the resulting polynomial fit. For a conceptual understanding is what is happening under the hood, Here is some code for doing this in R: https://github.com/jeffreyevans/spatialEco/blob/master/R/raster.deviation.R – Jeffrey Evans Oct 05 '23 at 18:23

2 Answers2

2

In QGIS:

  1. Select several control points on your DEM to create the surface. Create a new point layer and digitize these points.
  2. Obtain elevation data from the DEM at control points, by Add raster values to points tool in Processing Toolbox | SAGA | Vector <> raster
  3. Start Polynomial regression tool in Processing Toolbox | SAGA | Geostatistics. Select your control points as the input, and choose [0] simple planer surface. Also make sure to set the extent and the cell size as same as your DEM.
  4. Use raster calculator to subtract the output from the step 3 from your DEM. (or you may prefer Raster difference tool in Processing Toolbox | SAGA | Raster calculus).
Hornbydd
  • 43,380
  • 5
  • 41
  • 81
Kazuhito
  • 30,746
  • 5
  • 69
  • 149
0

I detrend a square DEM with sides of 2.5 km, resolution 1m like this:

  1. Create a point grid with 10 m spacing
  2. Sample raster values to give each point the value of the DEM
  3. IDW Interpolate the sampled points to create a raster with 10 m resolution
  4. Warp (resample) it to 1 m resolution
  5. Raster calculate the difference between original DEM and the warp output:

Start DEM: enter image description here

Detrended DEM: enter image description here

Hornbydd
  • 43,380
  • 5
  • 41
  • 81
BERA
  • 72,339
  • 13
  • 72
  • 161