ST_SetBandNoDataValue — 设置给定波段中表示无数据的数值。如果未指定波段,则假定为波段 1。要将波段标记为没有无数据值,请将无数据值设置为 NULL。
raster ST_SetBandNoDataValue(raster rast, double precision nodatavalue);
raster ST_SetBandNoDataValue(raster rast, integer band, double precision nodatavalue, boolean forcechecking=false);
设置表示波段中无数据的数值。如果未指定,则假定为波段 1。这将影响 ST_Polygon、ST_DumpAsPolygons 和 ST_PixelAs...() 函数的结果。
-- change just first band no data value
UPDATE dummy_rast
SET rast = ST_SetBandNoDataValue(rast,1, 254)
WHERE rid = 2;
-- change no data band value of bands 1,2,3
UPDATE dummy_rast
SET rast =
ST_SetBandNoDataValue(
ST_SetBandNoDataValue(
ST_SetBandNoDataValue(
rast,1, 254)
,2,99),
3,108)
WHERE rid = 2;
-- wipe out the nodata value this will ensure all pixels are considered for all processing functions
UPDATE dummy_rast
SET rast = ST_SetBandNoDataValue(rast,1, NULL)
WHERE rid = 2;