Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt

Use this file to discover all available pages before exploring further.

Add a band to a raster from an array of doubles.

Signatures

RS_AddBandFromArray (raster: Raster, band: ARRAY[Double])
RS_AddBandFromArray (raster: Raster, band: ARRAY[Double], bandIndex: Integer)
RS_AddBandFromArray (raster: Raster, band: ARRAY[Double], bandIndex: Integer, noDataValue: Double)

Parameters

raster
Raster
required
The input raster.
band
ARRAY[Double]
required
The band index.
bandIndex
Integer
The band index value.
noDataValue
Double
The NoData value to use for pixels outside the raster extent.

Return type

The resulting raster.
RS_AddBandFromArray typecasts the double band values to the given datatype of the raster. This can lead to overflow values if values beyond the range of the raster’s datatype are provided.

Example

SELECT RS_AddBandFromArray(raster, RS_MultiplyFactor(RS_BandAsArray(RS_FromGeoTiff(content), 1), 2)) AS raster FROM raster_table
SELECT RS_AddBandFromArray(raster, RS_MultiplyFactor(RS_BandAsArray(RS_FromGeoTiff(content), 1), 2), 1) AS raster FROM raster_table
SELECT RS_AddBandFromArray(raster, RS_MultiplyFactor(RS_BandAsArray(RS_FromGeoTiff(content), 1), 2), 1, -999) AS raster FROM raster_table
+--------------------+
|              raster|
+--------------------+
|GridCoverage2D["g...|
+--------------------+