All Products
Search
Document Center

PolarDB:ST_CoveredBy

Last Updated:Mar 28, 2026

Returns true if every point in the first argument lies inside or on the boundary of the second argument — equivalently, no point of the first argument lies outside the second argument. Both objects must share the same spatial reference system (SRS).

Syntax

bool ST_CoveredBy(raster rast1, raster rast2);
bool ST_CoveredBy(raster rast, geometry geom);
bool ST_CoveredBy(geometry geom, raster rast);

Parameters

ParameterDescription
rast1Raster object 1.
rast2Raster object 2.
rastThe raster object.
geomThe geometric object.

Examples

Filter rows where one raster is spatially covered by another:

SELECT a.id FROM tbl_a a, tbl_b b WHERE ST_CoveredBy(a.rast, b.rast);
 id
----
  1
(1 row)