This topic describes the ST_MakeEnvelope function. This function constructs a polygon object by using the minimum values and maximum values of coordinates.
Syntax
geometry ST_MakeEnvelope(double precision xmin , double precision ymin , double precision xmax , double precision ymax , integer srid);Parameters
| Parameter | Description |
|---|---|
| xmin | The minimum value of the x coordinate. |
| ymin | The minimum value of the y coordinate. |
| xmax | The maximum value of the x coordinate. |
| ymax | The maximum value of the y coordinate. |
| srid | The spatial reference identifier (SRID) of the polygon object. Default value: 0, which indicates that the SRID is unknown. |
Description
The maximum values and minimum values that you specify must be within the value ranges that are supported by the specified SRID.
Examples
SELECT ST_AsText(ST_MakeEnvelope(1, 2, 3, 4, 4326));
st_astext
--------------------------------
POLYGON((1 2,1 4,3 4,3 2,1 2))
(1 row)