Wednesday, February 24, 2016

Geography: Slope

How Slope works

For each cell, the Slope tool calculates the maximum rate of change in value from that cell to its neighbors. Basically, the maximum change in elevation over the distance between the cell and its eight neighbors identifies the steepest downhill descent from the cell.
Conceptually, the tool fits a plane to the z-values of a 3 x 3 cell neighborhood around the processing or center cell. The direction the plane faces is the aspect for the processing cell. The lower the slope value, the flatter the terrain; the higher the slope value, the steeper the terrain.
If there is a cell location in the neighborhood with a NoData z-value, the z-value of the center cell will be assigned to the location. At the edge of the raster, at least three cells (outside the raster's extent) will contain NoData as their z-values. These cells will be assigned the center cell's z-value. The result is a flattening of the 3 x 3 plane fitted to these edge cells, which usually leads to a reduction in the slope.
Fig. 1
Fig. 2

The Slope algorithm

Slope is commonly measured in units of degrees, which uses the algorithm:
\[slope\_\deg rees = \frac{{180}}{\pi } \times {\rm{ATAN}}\left( {\sqrt {{{\left( {\frac{{dz}}{{dx}}} \right)}^2} + {{\left( {\frac{{dz}}{{dy}}} \right)}^2}} } \right)\]
The rate of change in the x direction for cell e is calculated with the following algorithm:
\[\frac{{dz}}{{dx}} = \frac{{\left( {c + 2f + i} \right) - \left( {a + 2d + g} \right)}}{{8 \cdot x\_cellsize}}\]
The rate of change in the y direction for cell e is calculated with the following algorithm:
\[\frac{{dz}}{{dy}} = \frac{{\left( {g + 2h + i} \right) - \left( {a + 2b + c} \right)}}{{8 \cdot y\_cellsize}}\]
上面这个算法是计算3 x 3窗口不存在Nodata情况的算法,若存在Nodata或处在边缘位置,算法修正为毗邻像元与中心像元高程差最大的方向的角度θ,若中心像元高程是最大值,则该中心像元坡度设置为0,注意这个修正算法得出的结果可能不正确,所以在计算坡度时应该选择比研究区更大的高程数据,规避边缘效应。
示例数据分别在代码与ArcGIS中计算坡度,明显的差别主要分布在栅格数据的边缘,内部不存在明显的差异,之后裁剪出来所需研究区域即可,已经规避边缘影响。

References

No comments:

Post a Comment