Skip to content

RS_SetBandNoDataValue

Sets the nodata value of the specified band, packing the value into the band’s native data type. A null raster, band, or nodata value yields a null raster. This is metadata-only: raster cell values are not modified.

Usage

raster RS_SetBandNoDataValue(rast: raster, nodata: float64)
raster RS_SetBandNoDataValue(rast: raster, band: int, nodata: float64)

Arguments

  • rast (raster): Input raster
  • band (int): Band index (1-based).
  • nodata (float64): Nodata value to set. The raster must be single-band; for a multiband raster, specify the band with the three-argument form below.

Examples

SELECT RS_BandNoDataValue(RS_SetBandNoDataValue(RS_Example(), 1, 0), 1);
┌──────────────────────────────────────────────────────────────────────────────┐
│ rs_bandnodatavalue(rs_setbandnodatavalue(rs_example(),Int64(1),Int64(0)),Int │
│                                    64(1))…                                   │
╞══════════════════════════════════════════════════════════════════════════════╡
│                                                                          0.0 │
└──────────────────────────────────────────────────────────────────────────────┘
SELECT RS_BandNoDataValue(RS_SetBandNoDataValue(RS_Example(), 2, 255), 2);
┌──────────────────────────────────────────────────────────────────────────────┐
│ rs_bandnodatavalue(rs_setbandnodatavalue(rs_example(),Int64(2),Int64(255)),I │
│                                   nt64(2))…                                  │
╞══════════════════════════════════════════════════════════════════════════════╡
│                                                                        255.0 │
└──────────────────────────────────────────────────────────────────────────────┘