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

Returns true if raster or geometry on the left side intersects with the raster or geometry on the right side.
The convex hull of the raster is considered in the test.

<img src="https://mintcdn.com/wherobots/AayJA2u8CknIeTgt/images/sql-functions/RS_Intersects/RS_Intersects.svg?fit=max&auto=format&n=AayJA2u8CknIeTgt&q=85&s=824a5ce05530a0ba38e9d9e54cb74f21" alt="RS_Intersects" width="700" height="300" data-path="images/sql-functions/RS_Intersects/RS_Intersects.svg" />

Rules for testing spatial relationship:

* If the raster or geometry does not have a defined SRID, it is assumed to be in WGS84.
* If both sides are in the same CRS, then perform the relationship test directly.
* Otherwise, both sides will be transformed to WGS84 before the relationship test.

## Signatures

```sql theme={"system"}
RS_Intersects(raster: Raster, geom: Geometry)
```

```sql theme={"system"}
RS_Intersects(geom: Geometry, raster: Raster)
```

```sql theme={"system"}
RS_Intersects(raster0: Raster, raster1: Raster)
```

## Parameters

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

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

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

<ParamField body="geom" type="Geometry">
  The input geometry.
</ParamField>

## Return type

<ResponseField type="Boolean">
  Returns `true` or `false`.
</ResponseField>

## Example

```sql theme={"system"}
SELECT RS_Intersects(RS_MakeEmptyRaster(1, 20, 20, 2, 22, 1), ST_SetSRID(ST_PolygonFromEnvelope(0, 0, 10, 10), 4326)) rast_geom,
    RS_Intersects(RS_MakeEmptyRaster(1, 20, 20, 2, 22, 1), RS_MakeEmptyRaster(1, 10, 10, 1, 11, 1)) rast_rast
```

```
+---------+---------+
|rast_geom|rast_rast|
+---------+---------+
|     true|     true|
+---------+---------+
```
