All Products
Search
Document Center

PolarDB:ST_Intersects

Last Updated:Mar 28, 2026

Returns true if two geometry or geography objects share any part of space, and false otherwise.

Syntax

boolean ST_Intersects(geometry geomA, geometry geomB);
boolean ST_Intersects(geography geogA, geography geogB);

Parameters

ParameterDescription
geomAThe first geometry object.
geomBThe second geometry object.
geogAThe first geography object.
geogBThe second geography object.

Usage notes

  • Two objects intersect if their spatial relationship is Overlap, Touch, or Within.

  • For geography inputs, the function applies a tolerance of 0.00001 meters: points within this distance are treated as intersecting. The calculation uses a sphere model, not an ellipsoid model.

  • The function automatically uses all available indexes on the geometry objects to compare their bounding boxes.

Examples

Check whether two line strings intersect

SELECT ST_Intersects('LINESTRING(0 0,1 1)'::geometry,'LINESTRING(0 1,1 0)'::geometry);
 st_intersects
---------------
 t
(1 row)