Skip to main content
Returns the planar bounding box of a geometry as a typed Box2D value (four doubles: xmin, ymin, xmax, ymax). ST_Box2D is the typed counterpart to ST_Envelope. ST_Envelope returns the envelope as a Geometry — typically a polygon, but JTS may return a Point or LineString for degenerate inputs. ST_Box2D always returns a Box2D value that serializes to a struct of four non-nullable doubles and round-trips through Parquet without WKB overhead. It is also produced by the SQL cast CAST(geom AS box2d). Returns NULL for NULL or empty geometry input.

Signatures

Parameters

Geometry
required
The geometry whose planar bounding box is returned.

Return type

The planar bounding box as a Box2D value.

Example