Referência e Manual do Usuário

ST_Envelope

ST_Envelope toma um objeto de figura geométrica e retorna seu quadro delimitador como uma figura geométrica.

Sintaxe

db2gse.ST_Envelope(g db2gse.ST_Geometry)

Tipo de retorno

db2gse.ST_Geometry

Exemplos

A coluna GEOTYPE na tabela ENVELOPE_TEST armazena o nome da subclasse de figura geométrica armazenada na coluna de figura geométrica G1.

CREATE TABLE ENVELOPE_TEST (geotype varchar(20), g1 db2gse.ST_Geometry)

As seguintes instruções INSERT inserem cada subclasse de figura geométrica na tabela ENVELOPE_TEST.

INSERT INTO ENVELOPE_TEST
VALUES('Point',
       db2gse.ST_PointFromText('point (10.02 20.01)', 
 
db2gse.coordref()..srid(0)))
 
INSERT INTO ENVELOPE_TEST
VALUES ('Linestring',
        db2gse.ST_LineFromText('linestring (10.01 20.01, 10.01 30.01, 
        10.01 40.01)', db2gse.coordref()..srid(0)))
 
INSERT INTO ENVELOPE_TEST
VALUES ('Linestring',
       db2gse.ST_LineFromText('linestring  (10.02 20.01,10.32 23.98,
                                                                 11.92 25.64)',
 
db2gse.coordref()..srid(0)))
 
INSERT INTO ENVELOPE_TEST
VALUES('Polygon',
       db2gse.ST_PolyFromText('polygon ((10.02 20.01,11.92 35.64,25.02 34.15,
                                         19.15 33.94,10.02 20.01))',
 
db2gse.coordref()..srid(0)))
 
INSERT INTO ENVELOPE_TEST
VALUES('Multipoint',
       db2gse.ST_MPointFromText('multipoint (10.02 20.01,10.32
                                                          23.98,11.92 25.64)',
 
db2gse.coordref()..srid(0)))
 
INSERT INTO ENVELOPE_TEST
VALUES('Multilinestring',
       db2gse.ST_MLineFromText('multilinestring ((10.01 20.01,20.01 20.01,
       30.01 20.01), (30.01 20.01,40.01 20.01,50.01 20.01))',
 
db2gse.coordref()..srid(0)))
 
INSERT INTO ENVELOPE_TEST
VALUES('Multilinestring',
       db2gse.ST_MLineFromText('multilinestring ((10.02 20.01,10.32 23.98,
       11.92 25.64), ( 9.55 23.75,15.36 30.11))',
 
db2gse.coordref()..srid(0)))
 
INSERT INTO ENVELOPE_TEST
VALUES('Multipolygon',
       db2gse.ST_MPolyFromText('multipolygon (((10.02 20.01,11.92 35.64,
       25.02 34.15, 19.15 33.94,10.02 20.01)),
                                       ((51.71 21.73,73.36 27.04,71.52 32.87,
                                         52.43 31.90,51.71 21.73)))',
 
db2gse.coordref()..srid(0)))

A seguinte instrução SELECT relaciona o nome da subclasse ao lado de seu envelope. Como a função ST_Envelope retorna um ponto, uma cadeia de linha ou um polígono, sua saída será convertida em texto com a função ST_AsText. A função CAST converte o resultado padrão varchar(4000) da função ST_AsText para um varchar(280).

SELECT GEOTYPE, CAST(db2gse.ST_AsText(db2gse.ST_Envelope(g1)) AS varchar(280))
"The envelope"
FROM ENVELOPE_TEST

O seguinte conjunto de resultados retorna.

GEOTYPE              The envelope
-------------------- ----------------------------------------------------------
Point                POINT ( 10.02000000 20.01000000)
Linestring           LINESTRING ( 10.01000000 20.01000000, 10.01000000
 40.01000000)
Linestring           POLYGON (( 10.02000000 20.01000000, 11.92000000
 20.01000000, 11.92000000 25.64000000, 10.02000000 25.64000000, 10.02000000
 20.01000000))
Polygon              POLYGON (( 10.02000000 20.01000000, 25.02000000
 20.01000000, 25.02000000 35.64000000, 10.02000000 35.64000000, 10.02000000
 20.01000000))
Multipoint           POLYGON (( 10.02000000 20.01000000, 11.92000000
 20.01000000, 11.92000000 25.64000000, 10.02000000 25.64000000, 10.02000000
 20.01000000))
Multilinestring      LINESTRING ( 10.01000000 20.01000000, 50.01000000
 20.01000000)
Multilinestring      POLYGON (( 9.55000000 20.01000000, 15.36000000
 20.01000000, 15.36000000 30.11000000, 9.55000000 30.11000000, 9.55000000
 20.01000000))
Multipolygon         POLYGON (( 10.02000000 20.01000000, 73.36000000
 20.01000000, 73.36000000 35.64000000, 10.02000000 35.64000000, 10.02000000
 20.01000000))
 
  8 record(s) selected.


[ Início da Página | Página Anterior | Próxima Página | Índice | Índice Remissivo ]