All Products
Search
Document Center

ApsaraDB RDS:ST_Slope

Last Updated:Mar 28, 2026

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

ParameterDescription
rastThe raster object.
pyramid_levelThe pyramid level.
bandThe sequence number of the band.
extentThe area to analyze. Use the format '((minX,minY),(maxX,maxY))'.
typeThe coordinate type used to define the analysis area. You can specify only one value. Valid values: Raster (pixel coordinates) and World (world coordinates).
zfactorA conversion factor that adjusts the elevation unit when it differs from the horizontal coordinate unit. Default value: 1.
storageOptionThe 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;