For a given Digital Elevation Model (DSM) calculate at a pixel level the slope and aspect.
The following steps dictate the method for determining slope and aspect.
- A sobel filter is used to determine the rate of change at a pixel level for both the horizontal and vertical directions (dz/dx & dz/dy)
- Slope in radians = ATAN ( √ ([dz/dx]^2 + [dz/dy]^2) )
- Aspect in radians = atan2 ([dz/dy], -[dz/dx])
Both arrays are then converted to degrees.