> ## 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.

# RS_AddBandFromArray

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

## Signatures

```sql theme={"system"}
RS_AddBandFromArray (raster: Raster, band: ARRAY[Double])
```

```sql theme={"system"}
RS_AddBandFromArray (raster: Raster, band: ARRAY[Double], bandIndex: Integer)
```

```sql theme={"system"}
RS_AddBandFromArray (raster: Raster, band: ARRAY[Double], bandIndex: Integer, noDataValue: Double)
```

## Parameters

<ParamField body="raster" type="Raster" required>
  The input raster.
</ParamField>

<ParamField body="band" type="ARRAY[Double]" required>
  The band index.
</ParamField>

<ParamField body="bandIndex" type="Integer">
  The band index value.
</ParamField>

<ParamField body="noDataValue" type="Double">
  The NoData value to use for pixels outside the raster extent.
</ParamField>

## Return type

<ResponseField type="Raster">
  The resulting raster.
</ResponseField>

<Note>
  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.
</Note>

## Example

```sql theme={"system"}
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...|
+--------------------+
```
