Fork me on GitHub

ST_MakeEnvelope

Signatures

POLYGON ST_MakeEnvelope(DOUBLE xmin, DOUBLE ymin,
                        DOUBLE xmax, DOUBLE ymax);
POLYGON ST_MakeEnvelope(DOUBLE xmin, DOUBLE ymin,
                        DOUBLE xmax, DOUBLE ymax, INT srid);

Description

Creates a rectangular POLYGON formed xmin, xmax, ymin and ymax. The user may specify an srid.

Examples

SELECT ST_MakeEnvelope(0, 0, 1, 1);
-- Answer: POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))

SELECT ST_MakeEnvelope(0, 0, 1, 1, 4326);
-- Answer: POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))

SELECT ST_MakeEnvelope(0, -1, 2, 3);
-- Answer: POLYGON((0 -1, 2 -1, 2 3, 0 3, 0 -1))

SELECT ST_SRID(ST_MakeEnvelope(0, 0, 1, 1, 4326));
-- Answer: 4326
See also