ST_Within

更新时间:
复制 MD 格式

Returns true if the first object is completely within the second. Supports raster-to-raster and raster-to-geometry comparisons.

Syntax

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

Parameters

ParameterTypeDescription
rast1rasterThe first raster object.
rast2rasterThe second raster object.
rastrasterA raster object.
geomgeometryA geometric object.

Example

Query rows where a raster in tbl_a is completely within a raster in tbl_b:

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