ST_Box — Returns a Polygon geometry representation of the 2D or 3D bounding box
geometry ST_Box(
bytea
Geometry)
;
Returns a Polygon geometry representation of the bounding box
2D | 3D | M |
---|---|---|
- |
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 |
---|---|---|---|
- | - | - | - |
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))