ST_StatsQuantile

Updated at:
Copy as MD

Computes quantile statistics per band for a raster object and records the results in the raster's metadata.

Syntax

raster ST_StatsQuantile(raster raster_obj)

Parameters

ParameterDescription
raster_objThe raster object to analyze.

Description

ST_StatsQuantile computes quantile statistics for each band in the raster object and writes the results into the raster's metadata. The function returns the updated raster object.

Examples

Retrieve a raster, compute quantiles, and write the result back to the table

DO $$
declare
    rast raster;
begin
    select raster_obj into rast from raster_table where id = 1;
    rast = ST_StatsQuantile(rast);
    update raster_table set raster_obj = rast where id = 1;
end;
$$ LANGUAGE 'plpgsql';