Skip to main content
Builds a Box3D from two corner POINT Z geometries. Mirrors PostGIS’s ST_3DMakeBox. The corners are taken verbatim — no swapping or validation of ordering — so inverted bounds are preserved as supplied. POINT inputs without a Z dimension contribute z = 0, matching PostGIS. ST_3DMakeBox builds a cuboid from two corner POINT Z geometries Throws IllegalArgumentException if either argument is not a POINT. Returns NULL if either point is NULL or empty.

Signatures

ST_3DMakeBox(lowerLeft: Point, upperRight: Point)

Parameters

lowerLeft
Point
required
The lower-left corner point (a POINT Z; a 2D point contributes z = 0).
upperRight
Point
required
The upper-right corner point (a POINT Z; a 2D point contributes z = 0).

Return type

The 3D bounding box spanning the two corner points.

Example

SELECT ST_AsText(ST_3DMakeBox(ST_PointZ(1.0, 2.0, 3.0), ST_PointZ(4.0, 5.0, 6.0)))
BOX3D(1.0 2.0 3.0, 4.0 5.0 6.0)