Slope computation

Introduction

Slope angle, also known as slope gradient, is the angle α (Figure 1), between a path p in the horizontal plane and the sloping terrain. The path p must be chosen such that the angle α is maximal.

Figure 1. Slope angle defined. Here, δp stands for length in the horizontal plane, δf stands for the change in field value, where the field is usually terrain elevation. The slope angle is α.

A slope angle can be expressed as elevation gain in a percentage or as a geometric angle, in degrees or radians. The two respective formulas are:

slope%5C_perc%3D100%5Cfrac%7B%5Cdelta%20f%7D%7B%5Cdelta%0Ap%7D%5Cmathrm%7B~and~%7Dslope%5C_angle%3D%5Carctan%20%5Cleft(%5Cfrac%7B%5Cdelta%20f%7D%7B%5Cdelta%0Ap%7D%5Cright)
Equation 1

The path p must be chosen to provide the highest slope-angle value and thus it can lie in any direction. The compass direction, converted to an angle to North, of this maximal downslope path p is what is called the slope aspect.

Explanation

Let us now look at how to compute slope angle in a raster environment.

From an elevation raster, we cannot “read” the slope angle or slope aspect directly. Yet that information can be extracted. After all, for an arbitrary cell, we have its elevation value, plus those of its eight neighbouring cells. A simple approach to slope angle computation is to make use of x- and y- gradient filters. The x- gradient filter determines the slope increase ratio from west to east: if the elevation to the west of the centre cell is 1540 m and that to the east of the centre cell is 1552 m, then apparently along this transect the elevation increases 12 m per two cell widths, i.e. the x- gradient is 6 m per cell width. The y- gradient filter operates entirely analogously, though in the south-north direction.

Observe that both filters express elevation gain per cell width. This means that we must divide by the cell width - given in metres, for example - to obtain the (approximations to) the true derivatives δf ∕ δx and δf ∕ δy. Here, f stands for the elevation field as a function of x and y, and δf ∕ δx, for instance, is the elevation gain per unit of length in the x-direction.

Figure 2. Slope angle and slope aspect defined. Here, p is the horizontal path in maximal slope direction and α is the slope angle. The plane tangent to the terrain in the origin is also indicated. The angle ψ is the slope aspect.

To obtain the real slope angle α along path p, observe that both the x- and y- gradient contribute to it. This is illustrated in Figure 2. A not-so-simple geometric derivation can show that always:

%5Ctan(%5Calpha)%3D%5Csqrt%7B%5Cleft(%5Cfrac%7B%5Cdelta%20f%7D%7B%5Cdelta%0Ax%7D%5Cright)%5E2%2B%5Cleft(%5Cfrac%7B%5Cdelta%20f%7D%7B%5Cdelta%20y%7D%5Cright)%5E2%7D.
Equation 2

In the practice of computing local slope angles from an elevation raster, this means that we must perform the following steps:

  1. Compute from (input) elevation raster R the non-normalized x- and y- gradients.

  2. Normalize the resulting rasters by dividing by the cell width, expressed in units of length such as metres.

  3. Use both rasters for generating a third raster, applying the \sqrt{\dots} formula above, and possibly even an arctan function to the result, to obtain the slope angle α for each cell.

Learning outcomes

  • 11 - Spatial analysis: classes of functions

    Classify and explain spatial analysis functions (measurements, classification, overlay, neighbourhood and connectivity) in a raster and vector environment (level 1 and 2).

Prior knowledge

Outgoing relations

Learning paths