Checks whether a raster object contains another raster object or a geometry object in the same spatial reference system (SRS).
Syntax
bool ST_Contains(raster rast1, raster rast2);
bool ST_Contains(raster rast, geometry geom);
bool ST_Contains(geometry geom, raster rast);Parameters
| Parameter | Description |
|---|---|
rast1 | Raster object 1. |
rast2 | Raster object 2. |
rast | The raster object. |
geom | The geometry object. |
Examples
The following query returns all rows in tbl_a where the raster object contains the raster object from the corresponding row in tbl_b.
SELECT a.id FROM tbl_a a, tbl_b b WHERE ST_Contains(a.rast, b.rast);
id
----
1
(1 row)See also
ST_Within
ST_Intersects