ST_GrandMBR

Determine the bounding box from a set of geometries.

Syntax

ST_GrandMBR(geo);
geo
The input geometry.

Type: ST_GEOMETRY(ANY)

Returns

A value of type ST_GEOMETRY(200) that contains a geometry that represents the bounding box.

Examples

CREATE TABLE polygons (PointID INTEGER, the_geom ST_GEOMETRY(200));

INSERT INTO polygons VALUES (1, inza..ST_WKTToSQL('Polygon ((0 0, 11 0, 11 11, 0 11, 0 0))'));
INSERT INTO polygons VALUES (2, inza..ST_WKTToSQL('Polygon ((0 0, 22 0, 22 22, 0 22, 0 0))'));
INSERT INTO polygons VALUES (3, inza..ST_WKTToSQL('Polygon ((0 0, 33 0, 33 33, 0 33, 0 0))'));
INSERT INTO polygons VALUES (4, inza..ST_WKTToSQL('Polygon ((0 0, 44 0, 44 44, 0 44, 0 0))'));

SELECT inza..ST_AsText(inza..ST_GrandMBR(the_geom)) from polygons;

ST_ASTEXT
---------
POLYGON ((0 0, 44 0, 44 44, 0 44, 0 0))
(1 row)