Topography-related calculations with elevation data

Deriving topography-related variables from a DEM is a central task in terrain analysis. Many functions and algorithms have been developed for this purpose, and different GIS software packages include different sets of such tools. The raster package currently provides several basic terrain analysis functions (of which three examples will be shown in this section).

Note

A variety of terrain analysis (and other) algorithms are available in R through interfacing with open source GIS software, such as SAGA GIS (using the RSAGA package) and GRASS GIS (using the spgrass6 package). To use these, you will require to download and install the (freely available) respective software, but the subject is beyond the scope of the present book, which focuses on standalone R functionality.

Slope and aspect calculation

Calculation of topographic slope and aspect is among the most basic DEM analysis procedures. These two variables have many uses in their own right (for example, aspect is an important environmental measure due to its association with solar radiation load), and as inputs for subsequent calculations (for example, slope is one of the parameters in the calculation of Topographic Wetness Index). Both are calculated for each cell in an elevation raster by comparing focal cell elevation with the elevations of its eight neighbors (in a 3*3 neighborhood).

The terrain function can calculate slope and aspect (and several other terrain characteristics), when provided with a DEM raster and the respective option ("slope" or "aspect"). Let's take a look at the following example:

> slope = terrain(dem, "slope")
> aspect = terrain(dem, "aspect")

We now have slope and aspect rasters, by default in radians (using units="degrees" will give results in degrees instead). We can check what the results look like using the following expression:

> plot(stack(slope, aspect))

The following screenshot shows the graphical output:

Slope and aspect calculation

As expected, slope shows higher values across Mount Carmel and moderate values in the lowlands on both of its sides. The most prominent features in the aspect raster are the opposing aspects of the east-facing and west-facing slopes of Mount Carmel.

Hillshade

A hillshade layer is a hypothetical illumination appearance, as viewed from above, based on topography and the sun's position. Shaded relief maps, used to display topography in an intuitive manner, were traditionally prepared with manual shading (by an artist or a cartographer). Today, such maps can be generated by calculating a hillshade layer based on a DEM; this will be demonstrated in the following example.

The hillShade function can calculate a hillshade layer based on four parameters (the first two characterizing the topography and the last two characterizing the sun's position):

  • slope: Slope (in radians)
  • aspect: Aspect (in radians)
  • angle: The sun's elevation angle (in degrees)
  • direction: The sun's direction (in degrees)

For example, using the slope and aspect layers that we previously calculated, the following expression creates a hillshade layer according to the sun's elevation of 20 degrees and the sun's direction of 235 degrees:

> hill = hillShade(slope, aspect, 20, 235)

Now, with the following expression, we will plot the resulting hill raster using grayscale (as indicated by the par.settings argument GrTheme):

> levelplot(hill, par.settings = GrTheme, margin = FALSE)

The following screenshot shows the graphical output:

Hillshade

This image clearly shows the relief of Mount Carmel. Since the light source is located in the South-west (sun direction: 235°) and at quite a low angle above the horizon (sun elevation: 20°), the north-eastern slopes of the mountain are in shade while the western slopes are lighted.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.251.128