ST_Envelope¶
Returns the bounding box (envelope) of a geometry as a new geometry.
Usage¶
geometry ST_Envelope(geom: geometry)
Arguments¶
- geom (geometry): Input geometry
Description¶
Returns the minimum axis-aligned bounding box of a geometry. This is usually a polygon but can be a linestring for perfectly vertical or horizontal input.
Examples¶
SELECT ST_Envelope(ST_GeomFromWKT('LINESTRING(0 0, 3 4)'));
┌───────────────────────────────────────────────────────────┐
│ st_envelope(st_geomfromwkt(Utf8("LINESTRING(0 0, 3 4)"))) │
│ geometry │
╞═══════════════════════════════════════════════════════════╡
│ POLYGON((0 0,0 4,3 4,3 0,0 0)) │
└───────────────────────────────────────────────────────────┘
SELECT ST_Envelope(ST_Point(1.0, 2.0));
┌──────────────────────────────────────────────┐
│ st_envelope(st_point(Float64(1),Float64(2))) │
│ geometry │
╞══════════════════════════════════════════════╡
│ POINT(1 2) │
└──────────────────────────────────────────────┘