Name

ST_TPI — 계산된 지형위치지수(Topographic Position Index)와 함께 래스터를 반환합니다.

Synopsis

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

설명

Calculates the Topographic Position Index, which is defined as the focal mean with radius of one minus the center cell.

[Note]

이 함수는 1 반경 중심 평균(focalmean radius of one)만을 지원합니다.

2.1.0 버전부터 사용할 수 있습니다.

예시

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_TPI(rast, 1, '32BF'), 3, 3) AS tpi
FROM foo;
3.75