Skip to main content
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. RS_Intersects 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

RS_Intersects(raster: Raster, geom: Geometry)
RS_Intersects(geom: Geometry, raster: Raster)
RS_Intersects(raster0: Raster, raster1: Raster)

Parameters

raster0
Raster
The raster0 value.
raster1
Raster
The raster1 value.
raster
Raster
The input raster.
geom
Geometry
The input geometry.

Return type

Returns true or false.

Example

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|
+---------+---------+