Skip to main content
Return true if A intersects B. Polymorphic over input type:
  • (Geometry, Geometry) — topological intersection via JTS.
  • (Geography, Geography) — topological intersection via S2.
  • (Box2D, Box2D) — closed-interval bbox intersection on both axes (PostGIS && on box2d); edge- and corner-touching boxes count as intersecting. Throws IllegalArgumentException on inverted bounds. See Box2D optimization below.
  • (Box3D, Box3D) — closed-interval bbox intersection on all three axes (PostGIS &&& on box3d). Throws on inverted bounds on any axis.
ST_Intersects returning true ST_Intersects returning false

Signatures

Parameters

A
Geometry | Geography | Box2D | Box3D
required
The first input. Box2D / Box3D inputs use closed-interval semantics.
B
Geometry | Geography | Box2D | Box3D
required
The second input, of the same type family as A.

Return type

true if A intersects B.

Example

Box2D example:
For Box3D inputs the test covers all three axes — two boxes whose XY footprints overlap but whose Z ranges are disjoint do not intersect: Box3D ST_Intersects returning true: boxes overlap on all three axes Box3D ST_Intersects returning false: XY overlaps but Z is disjoint

Box2D optimization

ST_Intersects(box_col, lit_box) over a Box2D column and a literal Box2D is recognized by Sedona’s spatial optimizer:
  • Filter pushdown. When the column is a Box2D stored in GeoParquet, the predicate translates to Parquet row-group inequalities on the xmin / ymin / xmax / ymax leaves. See Box2D filter pushdown.
  • Spatial join. ST_Intersects(a, b) between two Box2D columns is planned as a range or broadcast-index join. See Box2D spatial join.