ST_MakeEnvelope()¶
Builds the axis-aligned rectangular envelope defined by two corner points.
Syntax¶
ST_MakeEnvelope(point1, point2)
Arguments¶
Argument |
Description |
|---|---|
|
First POINT corner. |
|
Opposite POINT corner. |
Return Value¶
Returns a GEOMETRY polygon.
Usage Notes¶
Corner order does not matter. Both inputs must be POINT values. Source evidence: test/distributed/cases/geo/geo_misc.sql.
Examples¶
DROP DATABASE IF EXISTS geo_operation_demo;
CREATE DATABASE geo_operation_demo;
USE geo_operation_demo;
SELECT ST_AsText(ST_MakeEnvelope(ST_GeomFromText('POINT(0 0)'), ST_GeomFromText('POINT(2 3)'))) AS envelope;
DROP DATABASE geo_operation_demo;