All Products
Search
Document Center

PolarDB:ST_Intersects

Last Updated:Mar 28, 2026

Checks whether a raster object intersects with another raster object or a geometry object within the same spatial reference system (SRS). Returns true if the objects share any space, false otherwise.

Syntax

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

Parameters

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

Returns

Boolean. Returns true if the objects intersect, false otherwise.

Examples

Find all rows in tbl_a whose raster intersects with any raster in tbl_b:

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