Checks whether a raster object intersects with another raster object or a geometry object in the same spatial reference system (SRS).
Syntax
bool ST_Intersects(raster rast1, raster rast2);
bool ST_Intersects(raster rast, geometry geom);
bool ST_Intersects(geometry geom, raster rast);Parameters
| Parameter | Description |
|---|---|
rast1 | The first raster object. |
rast2 | The second raster object. |
rast | The raster object. |
geom | The geometry object. |
Examples
Query all rows in tbl_a whose raster column intersects with any raster in tbl_b:
SELECT a.id FROM tbl_a a, tbl_b b WHERE ST_Intersects(a.rast, b.rast);Output:
id
----
1
(1 row)