ST_Within

更新时间:
复制 MD 格式

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

ParameterDescription
rast1The first raster object.
rast2The second raster object.
rastThe raster object.
geomThe 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)