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
| Parameter | Description |
|---|---|
rast1 | The first raster object. |
rast2 | The second raster object. |
rast | A raster object. |
geom | A 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);