PostGISSpatial Relationships

ST_Overlaps

What is ST_Overlaps?

ST_Overlaps is a PostGIS spatial predicate that returns true when two geometries of the same dimension share some but not all points, and their intersection has the same dimension as the inputs. In other words, they partially overlap without one containing the other.

SQL
ST_Overlaps(geometry geomA, geometry geomB)boolean

The DE-9IM pattern is T*T***T** for point/point and polygon/polygon, and 1*T***T** for line/line.

When would you use ST_Overlaps?

Use ST_Overlaps to find features that share territory without one fully containing the other — overlapping land-use parcels, competing service areas, or cadastral inconsistencies. It is a common data-quality check in parcel management and zoning databases, where two adjacent polygons should never partially share area.

SQL
1SELECT a.id, b.id
2FROM parcels a
3JOIN parcels b ON ST_Overlaps(a.geom, b.geom)
4WHERE a.id < b.id;

FAQs

How is ST_Overlaps different from ST_Intersects?

ST_Intersects returns true for any kind of shared points, including containment and boundary touches. ST_Overlaps is narrower: the geometries must be the same dimension, share interior points, and each must have interior points outside the other. Containment and equality do not qualify as overlap.

Why does ST_Overlaps return false when one polygon fully contains another?

Because in the OGC definition, "overlap" requires both geometries to have points outside each other. Full containment is a different relation (ST_Contains / ST_Within). If you want "any partial or full overlap" just use ST_Intersects.

Do the two geometries have to be the same type?

They must have the same dimension. Two lines can overlap, two polygons can overlap, two points can "overlap" (effectively equal), but a line does not overlap a polygon in the OGC sense — use ST_Crosses or ST_Intersects for mixed dimensions.

Is ST_Overlaps index-accelerated?

Yes — PostGIS applies the bounding-box operator && via the GiST index to prune candidates, then runs the full topological test. For overlap-detection joins on large parcel layers, make sure both sides have GiST indexes on the geometry column.