ST_SummaryStats
Calculates the statistics of a specified set of bands of a raster object.
Syntax
raster ST_SummaryStats(raster raster_obj)
raster ST_SummaryStats(raster raster_obj, cstring statsOption)
raster ST_SummaryStats(raster raster_obj,
cstring bands,
cstring statsOption)
Parameters
|
Parameter |
Description |
|
raster_obj |
The raster object. |
|
bands |
The specified band numbers. Band numbers start from 0. The format is
|
|
statsOptions |
The JSON string of statistics options. |
statsOptions is used to specify the statistics parameters. The parameters are as follows:
|
Parameter |
Description |
Type |
Format |
Default value |
Description details |
|
approx |
Specifies whether to use sampling to calculate statistics. |
boolean |
None |
true |
|
Example
Calculate the statistics of a specified set of bands of a raster object.
UPDATE raster_obj SET raster_obj=ST_SummaryStats(raster_obj) WHERE id = 1;
UPDATE rast SET rast=ST_SummaryStats(rast,'0-2','{"approx":false}') WHERE id = 1;
UPDATE rast SET rast=ST_SummaryStats(rast,'{"approx":false}') WHERE id = 1;