Skip to main content

ST_Intersects

Tests whether two geometries have any point in common (intersect).

Syntax

ST_Intersects(geometry_a, geometry_b)

Parameters

ParameterTypeDescription
geometry_aGeometryFirst geometry
geometry_bGeometrySecond geometry

Returns

TypeDescription
BooleanTrue if geometries intersect, false otherwise

Examples

Test Point in Polygon

SELECT ST_Intersects(
ST_Point(2, 2),
ST_GeomFromText('POLYGON((0 0, 4 0, 4 4, 0 4, 0 0))')
);
-- Returns: true

Spatial Join

SELECT a.id, b.name
FROM points a, regions b
WHERE ST_Intersects(a.geom, b.geom);

Find Overlapping Features

SELECT a.id as id_a, b.id as id_b
FROM parcels a, parcels b
WHERE a.id < b.id
AND ST_Intersects(a.geom, b.geom);

Notes

  • Returns true if geometries share any point (interior or boundary)
  • Opposite of ST_Disjoint
  • Most commonly used spatial predicate for spatial joins
  • Uses GEOS for computation

See Also