This topic describes the ST_ForceCollection function. This function converts a geometry object into a GeometryCollection object.
Syntax
geometry ST_ForceCollection(geometry geomA);Parameters
| Parameter | Description |
|---|---|
| geomA | The geometry object that you want to specify. |
Description
- The ST_ForceCollection function is useful for simplifying the Well-Known Binary (WKB) representation.
- This function supports circular strings, curves, and polyhedral surfaces.
- This function supports 3D objects and does not delete z coordinates.
Examples
SELECT ST_AsText(ST_ForceCollection(ST_GeomFromText('POLYGON((1 1,2 1,2 2,1 2,1 1))')));
st_astext
----------------------------------------------------
GEOMETRYCOLLECTION(POLYGON((1 1,2 1,2 2,1 2,1 1)))
(1 row)