Name

ST_TRI — Retourne un raster avec l'indice de rugosité du terrain (TRI) calculé.

Synopsis

raster ST_TRI(raster rast, integer nband, raster customextent, text pixeltype="32BF" , boolean interpolate_nodata=FALSE );

Description

L'indice de rugosité du terrain est calculé en comparant le pixel central à ses voisins, en prenant les valeurs absolues des différences et en faisant la moyenne du résultat.

[Note]

Cette fonction ne prend en charge qu'un rayon focal de un.

Disponibilité : 2.1.0

Exemples

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