All Products
Search
Document Center

ApsaraDB RDS:ST_BuildHistogram

Last Updated:Mar 28, 2026

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

ParameterTypeDescription
raster_objrasterThe 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)