Calculates the maximum rate of change in elevation from each cell to its eight neighboring cells across a raster surface, and returns a raster of slope values expressed in radians.
Syntax
raster ST_Slope(raster rast, integer pyramid_level, integer band, Box extent, BoxType type, float8 zfactor, cstring storageOption);Parameters
| Parameter | Description |
|---|---|
rast | The raster object. |
pyramid_level | The pyramid level. |
band | The sequence number of the band. |
extent | The area to analyze. Use the format '((minX,minY),(maxX,maxY))'. |
type | The coordinate type used to define the analysis area. You can specify only one value. Valid values: Raster (pixel coordinates) and World (world coordinates). |
zfactor | A conversion factor that adjusts the elevation unit when it differs from the horizontal coordinate unit. Default value: 1. |
storageOption | The storage option for the output raster object. For more information, see ST_ClipToRast. |
How it works
ST_Slope computes the maximum rate of change in elevation from each cell to its eight neighboring cells. The cell with the steepest downhill descent determines the slope value. Results are expressed in radians.
Example
SELECT st_slope(rast, 0, 0, '(0,0), (5,5)', 'Raster', 2.0)
FROM t_surface
WHERE id = 1;