ST_GeomCollection

Definition

ST_GeomCollection constructs a geometry collection from a well-known text representation.

Syntax

Oracle

sde.st_multilinestring (wkt clob, srid integer)
sde.st_multipoint (wkt clob, srid integer)
sde.st_multipolygon (wkt clob, srid integer)

PostgreSQL

sde.st_multilinestring (wkt, srid integer)
sde.st_multilinestring (esri_shape bytea, srid integer)
sde.st_multipoint (wkt, srid integer)
sde.st_multipoint (esri_shape bytea, srid integer)
sde.st_multipolygon (wkt, srid integer)
sde.st_multipolygon (esri_shape bytea, srid integer)

Return type

ST_GeomCollection

Example

Create a table, geomcoll_test.

CREATE TABLE geomcoll_test (id integer, geometry sde.st_geometry);

INSERT INTO geomcoll_test (id, geometry) VALUES (
1901,
sde.st_multipoint ('multipoint (1 2, 4 3, 5 6)', 0)
);

INSERT INTO geomcoll_test (id, geometry) VALUES (
1902,
sde.st_multilinestring ('multilinestring ((33 2, 34 3, 35 6),
(28 4, 29 5, 31 8, 43 12), (39 3, 37 4, 36 7))', 0)
);

INSERT INTO geomcoll_test (id, geometry) VALUES (
1903,
sde.st_multipolygon ('multipolygon (((3 3, 4 6, 5 3, 3 3),
(8 24, 9 25, 1 28, 8 24), (13 33, 7 36, 1 40, 10 43, 13 33)))', 0)
);

Select the geometry collection from the geomcoll_test table.

Oracle

SELECT id, sde.st_astext (geometry) Geomcollection
FROM GEOMCOLL_TEST;

        ID     GEOMCOLLECTION
    
      1901     MULTIPOINT (1.00000000 2.00000000, 4.00000000 3.00000000,
              	5.00000000 6.00000000)

      1902     MULTILINESTRING ((33.00000000 2.00000000, 34.00000000 
  		3.00000000, 35.00000000 6.00000000),(28.00000000 4.00000000,    
  		29.00000000 5.00000000, 31.00000000 8.00000000, 43.00000000   
   		12.00000000),(39.00000000 3.00000000, 37.00000000 
   		4.00000000, 36.00000000 7.00000000)) 

      1903     MULTIPOLYGON (((13.00000000 33.00000000, 10.00000000
  		43.00000000, 1.00000000 40.00000000, 7.00000000 36.00000000, 
   		13.00000000 33.00000000)),((8.00000000 24.00000000, 
   		9.00000000 25.00000000, 1.00000000 28.00000000, 8.00000000 
   		24.00000000)), ((3.00000000 3.00000000,5.00000000 
   		3.00000000, 4.00000000 6.00000000,3.00000000 3.00000000)))

PostgreSQL

SELECT id, sde.st_astext (geometry) 
AS geomcollection
FROM geomcoll_test;

        id     geomcollection
    
1901     MULTIPOINT (1 2, 4 3, 5 6)

1902     MULTILINESTRING ((33 2, 34	3, 35 6),(28 4,
29 5, 31 8, 43 12),(39 3, 37 4, 36 7)) 

1903     MULTIPOLYGON (((13 33, 10 43, 1 40, 7 36,
13 33)),((8 24, 9 25, 1 28, 8 24)), 3 3, 5 3, 4 6, 3 3)))
6/19/2015