名称

ST_SetBandNoDataValue — 设置代表无数据的给定波段的值。 如果未指定波段,则假定为波段 1。 要将波段标记为没有 nodata 值,请设置 nodata 值 = NULL。

大纲

raster ST_SetBandNoDataValue(raster rast, double precision nodatavalue);

raster ST_SetBandNoDataValue(raster rast, integer band, double precision nodatavalue, boolean forcechecking=false);

Description

设置表示该带没有数据的值。 如果未指定,则假定为波段 1。 这将影响ST_PolygonST_DumpAsPolygons 和 ST_PixelAs...() 函数的结果。

示例

This example changes only the first band NODATA value.

Code
UPDATE dummy_rast
    SET rast = ST_SetBandNoDataValue(rast, 1, 254)
WHERE rid = 2;

This example changes the NODATA value for bands 1, 2, and 3.

Code
UPDATE dummy_rast
    SET rast =
        ST_SetBandNoDataValue(ST_SetBandNoDataValue(ST_SetBandNoDataValue(rast, 1, 254),
                2, 99),
                3, 108)
        WHERE rid = 2;

This example removes the NODATA value so that all pixels are considered by processing functions.

Code
UPDATE dummy_rast
    SET rast = ST_SetBandNoDataValue(rast, 1, NULL)
WHERE rid = 2;