Skip to content

ST_INTERSECTS

Returns TRUE if two GEOGRAPHY objects intersect. Two geographies intersect if they share any common point.

For GEOGRAPHY, a distance tolerance of 0.00001 meters is applied, meaning points that are very close are considered to intersect.

This function is symmetric, meaning:

  • ST_INTERSECTS(a, b) = ST_INTERSECTS(b, a)

See also:

Syntax

sql
ST_INTERSECTS(<a>, <b>)

Arguments

  • <a> and <b>: The two GEOGRAPHY objects to test for intersection

Returns

Returns a BOOLEAN:

  • TRUE if the GEOGRAPHY objects share any common points
  • FALSE otherwise

Example

sql
SELECT ST_Intersects('POINT(0 0)'::GEOGRAPHY, 'LINESTRING(0 0, 1 1)'::GEOGRAPHY);
-- TRUE

SELECT ST_Intersects('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'::GEOGRAPHY, 'POINT(2 2)'::GEOGRAPHY);
-- FALSE