Computes and stores the histogram for all bands of a raster object. The result is written back into the raster object, not returned as a query result.
Syntax
raster ST_BuildHistogram(raster raster_obj)Parameters
| Parameter | Type | Description |
|---|---|---|
raster_obj | raster | The raster object whose band histograms are computed and stored. The function returns an updated raster object with the histogram data embedded. |
Examples
Build a histogram for the raster object with id = 1 and save it back to the same row:
UPDATE raster_table SET raster_obj = ST_BuildHistogram(raster_obj) WHERE id = 1;Expected output:
(1 row)