Name

ST_Force_Collection — Forces the geometry to be a GEOMETRYCOLLECTION.

Synopsis

geometry ST_Force_Collection(bytea Geometry);

Alias

Force_Collection

Description

Forces the geometry to be a GEOMETRYCOLLECTION. The collection classes of geometries (MultiPoint, MultiLineString, Multipolygon) are split into single classes (Point, LineString, Polygon).

Coordinate Dimensions
2D3DM
Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
----

Examples

SELECT ST_AsEWKT(ST_Force_Collection(ST_GeomFromEWKT('POINT(0 0 -4)')));
--Result
GEOMETRYCOLLECTION (POINT (0 0 -4))

SELECT ST_AsEWKT(ST_Force_Collection(ST_GeomFromEWKT('MULTILINESTRING ((0 0, 10 10, 20 10),(30 30, 40 40, 50 40))')));
--Result
GEOMETRYCOLLECTION (LINESTRING (0 0, 10 10, 20 10), LINESTRING (30 30, 40 40, 50 40))

SELECT ST_AsEWKT(ST_Force_Collection(ST_GeomFromEWKT('MULTIPOINT(0 0 1 -4,1 1 2 -5)')));
--Result
GEOMETRYCOLLECTION (POINT (0 0 1 -4), POINT (1 1 2 -5))

Related functions

ST_Collect, ST_MakeGeomColl