获取影像的波段百分比值。

语法

float8 ST_Percentile(raster raster_obj,
                     integer band,
                     integer percentage)

参数

参数名称描述
raster_objraster对象。
band指定的波段序号,从0开始。
percentageraster对象的百分比。可通过ST_BuildPercentilesST_ComputeStatistics获取。

示例

SELECT st_percentile(rast_obj, 0, 10)
FROM raster_table
WHERE id = 1;

--------------------
29.7
ST_Quantile的功能也可以使用ST_Percentile实现:
SELECT st_percentile(rast_obj, 0, 25), st_percentile(rast_obj, 0, 50)
FROM raster_table
WHERE id = 1;