ST_Percentile

更新时间:
复制 MD 格式

Returns the percentage value of a raster band.

Syntax

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

Parameters

Parameter Name

Description

raster_obj

The raster object.

band

The number of the specified band. The value starts from 0.

percentage

The percentiles of the raster object, which you can obtain using ST_BuildPercentiles or ST_ComputeStatistics.

Examples

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

--------------------
29.7

You can also use ST_Percentile to achieve the same results as ST_Quantile:

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