Appearance
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 twoGEOGRAPHYobjects to test for intersection
Returns
Returns a BOOLEAN:
TRUEif theGEOGRAPHYobjects share any common pointsFALSEotherwise
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