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.


2 Answers 2



  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).

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.