This tool calculates slope gradient (i.e. slope steepness in degrees, radians, or percent) for each grid cell in an input digital elevation model (DEM). The user must input a DEM (dem
). The Z conversion factor is only important when the vertical and horizontal units are not the same in the DEM. When this is the case, the algorithm will multiply each elevation in the DEM by the Z conversion factor.
The tool uses Horn's (1981) 3rd-order finite difference method to estimate slope. Given the following clock-type grid cell numbering scheme (Gallant and Wilson, 2000),
7 | 8 | 1 | \ |
6 | 9 | 2 | \ |
5 | 4 | 3 |
slope = arctan(fx2 + fy2)0.5
where,
fx = (z3 - z5 + 2(z2 - z6) + z1 - z7) / 8 * Δx
and,
fy = (z7 - z5 + 2(z8 - z4) + z1 - z3) / * Δy
Δx and Δy are the grid resolutions in the x and y direction respectively
Gallant, J. C., and J. P. Wilson, 2000, Primary topographic attributes, in Terrain Analysis: Principles and Applications, edited by J. P. Wilson and J. C. Gallant pp. 51-86, John Wiley, Hoboken, N.J.
aspect, plan_curvature, profile_curvature
def slope(self, dem: Raster, units: str = "degrees", z_factor: float = 1.0) -> Raster: ...