Frequently asked question
Note:
If any neighborhood cells are NoData, they are assigned the value of the center cell. An example of this is when the 3x3 window is on an edge of a raster.
Taking the illustration above, the rate of change in the x direction for cell ‘e’ is calculated with the following algorithm:
(dz/dx) = ((c + 2f + i) - (a + 2d + g)) / 8
For example:
(dz/dx) = ((85 + 170 + 84)) - (101 + 202 + 101)) / 8
(dz/dx) = -8.125
The rate of change in the y direction for cell ‘e’ is calculated with the following algorithm:
(dz/dy) = ((g + 2h + i) - (a + 2b + c)) / 8
For example:
(dz/dy) = ((101 + 182 + 84) - (101 + 184 + 85)) / 8
(dz/dy) = -0.375
Taking the rate of change in the x and y direction for cell ‘e’, aspect is calculated using:
aspect = 57.29578 * atan2 (dz/dy, -dz/dx)
For example:
aspect = 57.29578 * atan2 (-0.375, 8.125)
aspect = -2.64
The above aspect value is then converted to values ranging in the compass directions (0 - 360 degrees) according to the following rule:
if aspect < 0
cell = 90.0 - aspect
else if aspect > 90.0
cell = 360.0 - aspect + 90.0
else
cell = 90.0 – aspect
For example:
Aspect = -2.64
aspect < 0
Cell = 90.0 - aspect
Cell = 90 – (-2.64)
Cell = 90 + 2.64
Cell = 92.64
The aspect value of 92 for cell ‘e’ = East.
Reference
Burrough, P. A. and McDonell, R.A., 1998. Principles of Geographical Information Systems (Oxford University Press, New York), p. 190.
Get help from ArcGIS experts
Download the Esri Support App