All Products
Search
Document Center

AnalyticDB:ST_overlaps

Last Updated:Mar 28, 2026

Returns true if two raster objects, or a raster object and a geometry object, intersect but neither completely contains the other.

Syntax

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

Parameters

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

Return value

Returns true if the two objects intersect and neither completely contains the other. Returns false if one object fully contains the other, or if the objects do not intersect.

Example

The following example returns the IDs of rows in tbl_a whose raster objects overlap with the raster objects in tbl_b.

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