ST_TRI
Name
ST_TRI — Returns a raster with the calculated Terrain Ruggedness Index.
Synopsis
raster
ST_TRI
(
raster
rast
, integer
nband
, raster
customextent
, text
pixeltype="32BF"
, boolean
interpolate_nodata=FALSE
)
;
Description
Terrain Ruggedness Index is calculated by comparing a central pixel with its neighbors, taking the absolute values of the differences, and averaging the result.
|
|
|
This function only supports a focalmean radius of one. |
Availability: 2.1.0
Examples
WITH foo AS (
SELECT ST_SetValues(ST_AddBand(ST_MakeEmptyRaster(5, 5, 0, 0, 1, -1, 0, 0, 0), 1, '32BF', 0, -9999),
1, 1, 1, ARRAY[
[1, 1, 2, 3, 3],
[1, 2, 4, 15, 3],
[2, 4, 10, 7, 5],
[3, 5, 7, 6, 4],
[3, 3, 5, 4, 4]
]::double precision[][]
) AS rast
)
SELECT ST_Value(ST_TRI(rast, 1, '32BF'), 3, 3) AS tri
FROM foo;
5
See Also
ST_MapAlgebra (callback function version) , ST_Roughness , ST_TPI , ST_Slope , ST_HillShade , ST_Aspect