Checks whether a raster object contains another raster object or a geometry object in the same spatial reference system.
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 | The raster object to test as the container. |
rast2 | The raster object to test as the contained object. |
rast | A raster object. |
geom | A geometry object. |
Examples
The following example finds all rows in tbl_a whose raster object fully contains the raster objects in tbl_b.
SELECT a.id FROM tbl_a a, tbl_b b WHERE ST_Contains(a.rast, b.rast);Output:
id
----
1
(1 row)