(Geometry, Geometry)— topological containment via JTS.(Geography, Geography)— topological containment via S2.(Box2D, Box2D)— closed-interval bbox containment on both axes (PostGIS~onbox2d). ThrowsIllegalArgumentExceptionon inverted bounds. See Box2D optimization below.(Box3D, Box3D)— closed-interval bbox containment on all three axes. Throws on inverted bounds on any axis.
Signatures
Parameters
The containing input.
Box2D / Box3D inputs use closed-interval semantics.The contained input, of the same type family as
A.Return type
true if A fully contains B.Example
Box3D inputs containment must hold on all three axes — a box contained within another’s XY footprint but extending past it in Z is not contained:
Box2D optimization
ST_Contains(box_col, lit_box) over a Box2D column and a literal Box2D (and the reversed form) is recognized by Sedona’s spatial optimizer:
- Filter pushdown. When the column is a
Box2Dstored in GeoParquet, the predicate translates to Parquet row-group inequalities on thexmin/ymin/xmax/ymaxleaves. See Box2D filter pushdown. - Spatial join.
ST_Contains(a, b)between twoBox2Dcolumns is planned as a range or broadcast-index join withCOVERSsemantics (closed-interval containment). See Box2D spatial join.

