Nome

ST_Envelope — Retorna uma geometria representando a precisão da dobrada (float8) da caixa limitada da geometria fornecida.

Sinopse

geometry ST_Envelope(geometry g1);

Descrição

Retorna o limite mínimo da caixa float8 para a geometria fornecida, com uma geometria. O polígono é definido pelos pontos de canto da caixa limitada ((MINX, MINY), (MINX, MAXY), (MAXX, MAXY), (MAXX, MINY), (MINX, MINY)). (PostGIS irá adicionar uma ZMIN/ZMAX coordenada também).

Casos degenerados (linhas verticais, pontos) irão retornar como uma geometria de dimensão menor que POLÍGONO, ie. PONTO ou LINESTRING.

Disponibilidade: 1.5.0 comportamento alterado para saída de precisão dupla ao invés de float4

This method implements the OGC Simple Features Implementation Specification for SQL 1.1. s2.1.1.1

This method implements the SQL/MM specification. SQL-MM 3: 5.1.19

Exemplos

Code
SELECT ST_Envelope('POINT(1 3)'::geometry);
Raster Outputs
POINT(1 3)
Figure
Geometry figure for visual-st-envelope-01
Code
SELECT ST_Envelope('LINESTRING(0 0,1 3)'::geometry);
Raster Outputs
POLYGON((0 0,0 3,1 3,1 0,0 0))
Figure
Geometry figure for visual-st-envelope-02
Code
SELECT ST_Envelope('POLYGON((0 0,0 1,1.0000001 1,1.0000001 0,0 0))'::geometry);
Raster Outputs
POLYGON((0 0,0 1,1.0000001 1,1.0000001 0,0 0))
Figure
Geometry figure for visual-st-envelope-03
Code
SELECT ST_Envelope('POLYGON((0 0,0 1,1.0000000001 1,1.0000000001 0,0 0))'::geometry);
Raster Outputs
POLYGON((0 0,0 1,1.0000000001 1,1.0000000001 0,0 0))
Figure
Geometry figure for visual-st-envelope-04
Code
SELECT Box3D(geom), Box2D(geom), ST_Envelope(geom) As envelopewkt
    FROM (SELECT 'POLYGON((0 0,0 1000012333334.34545678,1.0000001 1,1.0000001 0,0 0))'::geometry As geom) As foo;

Envelope of a point and LineString.

Code
SELECT ST_Envelope(ST_Collect(
            'LINESTRING(55 75,125 150)',
            ST_Point(20, 80)
            )) As wktenv;
Raster Outputs
POLYGON((20 75,20 150,125 150,125 75,20 75))
Figure
Geometry figure for visual-st-envelope-05