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

Returns a combined multi-band raster from 2 or more input Rasters. The order of bands in the resultant raster will be in the order of the input rasters. For example if `RS_Union` is called on two 2-banded raster, raster1 and raster2, the first 2 bands of the resultant 4-banded raster will be from raster1 and the last 2 from raster 2.

<Note>
  If the provided input Rasters don't have same shape an IllegalArgumentException will be thrown.
</Note>

<img src="https://mintcdn.com/wherobots/AayJA2u8CknIeTgt/images/sql-functions/RS_Union/RS_Union.svg?fit=max&auto=format&n=AayJA2u8CknIeTgt&q=85&s=d49d57b5495955fa0f4191fb95a5e7e8" alt="RS_Union" width="800" height="440" data-path="images/sql-functions/RS_Union/RS_Union.svg" />

## Signatures

```sql theme={"system"}
RS_Union (raster1: Raster, raster2: Raster)
```

```sql theme={"system"}
RS_Union (raster1: Raster, raster2: Raster, raster3: Raster)
```

```sql theme={"system"}
RS_Union (raster1: Raster, raster2: Raster, raster3: Raster, raster4: Raster)
```

```sql theme={"system"}
RS_Union (raster1: Raster, raster2: Raster, raster3: Raster, raster4: Raster, raster5: Raster)
```

```sql theme={"system"}
RS_Union (raster1: Raster, raster2: Raster, raster3: Raster, raster4: Raster, raster5: Raster, raster6: Raster)
```

```sql theme={"system"}
RS_Union (raster1: Raster, raster2: Raster, raster3: Raster, raster4: Raster, raster5: Raster, raster6: Raster, raster7: Raster)
```

## Parameters

<ParamField body="raster1" type="Raster" required>
  The raster1 value.
</ParamField>

<ParamField body="raster2" type="Raster" required>
  The raster2 value.
</ParamField>

<ParamField body="raster3" type="Raster">
  The raster3 value.
</ParamField>

<ParamField body="raster4" type="Raster">
  The raster4 value.
</ParamField>

<ParamField body="raster5" type="Raster">
  The raster5 value.
</ParamField>

<ParamField body="raster6" type="Raster">
  The raster6 value.
</ParamField>

<ParamField body="raster7" type="Raster">
  The raster7 value.
</ParamField>

## Return type

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

## Example

```sql theme={"system"}
SELECT RS_Union(raster1, raster2, raster3, raster4) FROM rasters
```

```
GridCoverage2D["g...
```
