ST_Intersects
What is ST_Intersects?
ST_Intersects is the fundamental PostGIS spatial predicate. It returns true when two geometries share any portion of space — whether through interior, boundary, or a single touching point.
1ST_Intersects(geometry geomA, geometry geomB) → boolean
2ST_Intersects(geography geogA, geography geogB) → booleanThe DE-9IM pattern is satisfied by anything except FF*FF****, which is why ST_Intersects(A, B) is equivalent to NOT ST_Disjoint(A, B).
When would you use ST_Intersects?
ST_Intersects is the default predicate for "does A touch B at all?" — the most common question in spatial analysis. Use it to find all features within a study area, join points of interest with administrative boundaries, detect conflicts between infrastructure plans and protected areas, or filter tiles that intersect a viewport.
1SELECT poi.id, poi.name
2FROM pois
3JOIN districts d ON ST_Intersects(poi.geom, d.geom)
4WHERE d.name = 'Centro';FAQs
How does ST_Intersects differ from ST_Touches, ST_Overlaps, and ST_Within?
ST_Intersects is the umbrella predicate: it is true for any shared points, including boundary-only contact (ST_Touches), partial overlap (ST_Overlaps), complete containment (ST_Within/ST_Contains), and equality. The narrower predicates let you distinguish the kind of intersection — use them when the type of relationship matters.
Does ST_Intersects use a GiST index?
Yes — this is where spatial indexes shine. PostGIS first applies the bounding-box operator && against the GiST index, then evaluates the exact predicate only on the shortlisted candidates. Ensure every geometry column used in joins has CREATE INDEX ... USING GIST (geom).
Should I use geometry or geography for global data?
For global or continental datasets in EPSG:4326, use geography. It evaluates intersection on the sphere, correctly handling features that cross the antimeridian or sit near the poles. For local projected data, geometry is faster and more flexible.
How do empty geometries behave?
If either input is empty, ST_Intersects returns false. This can surprise users who expect every geometry to at least "intersect itself" — but an empty geometry has no points, so the relation is trivially false. Filter empty geometries out with NOT ST_IsEmpty(geom) if they contaminate your results.