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
| Parameter | Type | Description |
|---|---|---|
rast |
raster | The raster object to update. |
band |
integer | The band index, starting from 0. |
min |
double | The minimum pixel value. |
max |
double | The maximum pixel value. |
mean |
double | The mean (average) of all pixel values. |
std |
double | The standard deviation of all pixel values. |
samplingParams |
cstring | Controls 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)
该文章对您有帮助吗?