Name

ST_Box — Returns a Polygon geometry representation of the 2D or 3D bounding box

Synopsis

geometry ST_Box(bytea Geometry);

Alias

Box, ST_Box, ST_AsBox

Description

Returns a Polygon geometry representation of the bounding box

Coordinate Dimensions
2D3DM

-

Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
----

Examples

SELECT ST_AsEWKT(ST_Box(ST_GeomFromText('LINESTRING (1 1, 2 3, 3 2, 4 4)',25830)));
--Result
SRID=25830;POLYGON ((1 1, 1 4, 4 4, 4 1, 1 1))

SELECT ST_AsEWKT(ST_Box(ST_GeomFromText('LINESTRING (1 1 -5, 2 3 10, 3 2 5, 4 4 0)',25830)));
--Result
SRID=25830;POLYGON ((1 1 -5, 1 4 10, 4 4 10, 4 1 -5, 1 1 -5))

Related functions

ST_Box2D,ST_Box3D