ST_Contains

更新时间:
复制 MD 格式

This function identifies the spatial relationship between two raster objects or between a raster object and a geometric object to determine whether the first specified object completely contains the second.

Syntax

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

Parameters

ParameterDescription
rast1The first raster object.
rast2The second raster object.
rastA raster object.
geomA geometry object.

Example

The following query returns the IDs of rows in tbl_a whose raster completely contains the raster in tbl_b:

SELECT a.id
FROM tbl_a a, tbl_b b
WHERE ST_Contains(a.rast, b.rast);