All Products
Search
Document Center

AnalyticDB:ST_SetNoData

Last Updated:Mar 28, 2026

Sets the NoData value for a specified band of a raster object. Setting a NoData value marks which pixel value represents "no data" — it does not modify existing pixel values in the raster.

Syntax

raster ST_SetNoData(raster rast, integer band_sn, double nodata_value);

Parameters

ParameterDescription
rastThe raster object.
bandThe sequence number of the band, which starts from 0. A value of -1 indicates all bands.
nodata_valueThe NoData value of the band.

Examples

Set the NoData value for band 0:

update rast set rast=ST_SetNoData(rast,0, 999.999);
(1 row)

Set the NoData value for all bands:

update rast set rast=ST_SetNoData(rast,-1, 999.999);