Checks whether a raster object falls within another raster object or a geometry object. Both objects must share the same spatial reference system. Returns true if the first object is fully contained within the second; otherwise, returns false.
Syntax
bool ST_Within(raster rast1, raster rast2);
bool ST_Within(raster rast, geometry geom);
bool ST_Within(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
The following example queries all rows in tbl_a where the raster object falls within a raster object in tbl_b.
SELECT a.id FROM tbl_a a, tbl_b b WHERE ST_Within(a.rast, b.rast);
id
----
1
(1 row)该文章对您有帮助吗?