ST_INTERSECTS()

All functions > GEOSPATIAL > ST_INTERSECTS()

Returns TRUE if two geometries or geographies share any portion of space.

Signatures

Intersects

Returns: TRUE if the inputs intersect, FALSE otherwise

ST_INTERSECTS(geo1: T, geo2: T) → BOOLEAN
sql
ParameterTypeRequiredDescription
geo1TYesFirst geometry or geography
geo2TYesSecond geometry or geography

With:

  • T : Custom types: GEOM_POINT | GEOM_LINESTRING | GEOM_POLYGON | GEOM_MULTIPOINT | GEOM_MULTILINESTRING | GEOM_MULTIPOLYGON | GEOM_MULTIANY | GEOG_POINT | GEOG_LINESTRING | GEOG_POLYGON | GEOG_MULTIPOINT | GEOG_MULTILINESTRING | GEOG_MULTIPOLYGON | GEOG_MULTIANY

Signature notes:

  • Accepts any sub kind combination
  • Equivalent to NOT ST_DISJOINT(a, b)
  • Both inputs must be the same type family (both GEOMETRY or both GEOGRAPHY)
  • Returns NULL if either input is NULL
  • This is the most commonly used spatial predicate for spatial joins

Examples

Geometry

FeatureQL
SELECT
    f1 := ST_INTERSECTS(ST_GEOMFROMTEXT('POLYGON ((0 0, 2 0, 2 2, 0 2, 0 0))'), ST_GEOMPOINT(1.0, 1.0)), -- Point inside polygon
    f2 := ST_INTERSECTS(ST_GEOMFROMTEXT('POLYGON ((0 0, 2 0, 2 2, 0 2, 0 0))'), ST_GEOMPOINT(5.0, 5.0)) -- Point outside polygon
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

Geography

FeatureQL
SELECT
    f1 := ST_INTERSECTS(ST_GEOGFROMTEXT('POLYGON ((2.29 48.85, 2.36 48.85, 2.36 48.87, 2.29 48.87, 2.29 48.85))'), ST_GEOGPOINT(2.33, 48.86)) -- Point in Paris polygon
;
Result
f1 BOOLEAN
true

Last update at: 2026/05/26 17:22:09