I am using python 3.X and I am transforming a DEM (from a raster GeoTIFF file) into a slop tif file. I am using GDAL and rasterio to do that.

Specifically, I am using the method:

gdal.DEMProcessing(output, input, 'slope')

My problem is I do not know what is the mathematics and what exact method GDAL uses to calculate the slope. I can't find the answer in the GDAL documentation.

Can anyone can point me to that?

  • 2
    Two methods are named in the documentation Use Zevenbergen & Thorne formula, instead of Horn’s formula, to compute slope & aspect. The literature suggests Zevenbergen & Thorne to be more suited to smooth landscapes, whereas Horn’s formula to perform better on rougher terrain – user30184 Sep 11 '19 at 18:41
  • 1
    If all else fails you can read the code – Ian Turton Sep 11 '19 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.