ST_SetStatistics

更新时间:
复制 MD 格式

Writes band statistics (min, max, mean, and standard deviation) to a specified band of a raster object.

Syntax

raster ST_SetStatistics(raster rast, integer band, double min, double max, double mean, double std, cstring samplingParams);

Parameters

ParameterTypeDescription
rastrasterThe raster object to update.
bandintegerThe band index, starting from 0.
mindoubleThe minimum pixel value.
maxdoubleThe maximum pixel value.
meandoubleThe mean (average) of all pixel values.
stddoubleThe standard deviation of all pixel values.
samplingParamscstringControls whether the stored statistics are marked as exact or approximate. Valid values: {"approx":false} and {"approx":true}.

Example

Set statistics for band 0 of the raster object stored in the rast column:

UPDATE rast SET rast = ST_SetStatistics(rast, 0, 0.0, 255.0, 125.0, 23.6, '{"approx":false}');
(1 row)