To begin we need to take the DEM and compute a mean filter on the data. Basically for each pixel a neighborhood statistic is calculated (e.g. mean, max min etc.). However, we need to first define the neighborhood. I decided to use a neighborhood of 3 by 3 pixels. The Switzerland DEM has a pixel resolution of 0.008333 degrees, this is about 1 km^2. Not exactly 1 km^2, but 928 by 1360 meters or 1.3 km^2. This means that for every pixel, R will calculate the average elevation of a 9 km^2 neighborhood. Essential this ends up smoothing out the DEM.
- Ridges Zo > SD
- Upper Slope SD >= Zo > SD/2
- Middle Slope SD/2 >= Zo >= 0
- Flat Area 0 > Zo >= -SD/2
- Lower Slope -SD/2 > Zo >= -SD
- Valley Z0 < - SD
Weiss, A., 2001, July. Topographic position and landforms analysis. InPoster presentation, ESRI user conference, San Diego, CA (Vol. 200).