Returns the simplest geometry representation of a GeometryCollection.
Syntax
geometry ST_CollectionHomogenize(geometry collection);Parameters
| Parameter | Description |
|---|---|
| collection | The input GeometryCollection. |
Description
If the collection contains a collection of singleton objects, the function returns a singleton object.
If the collection contains multiple geometries of the same type, the function returns the equivalent MULTI geometry type.
Examples
SELECT ST_AsText(ST_CollectionHomogenize(ST_GeomFromText('GEOMETRYCOLLECTION(LINESTRING(1 1,2 1),LINESTRING(2 1,2 2))')));Output:
st_astext
--------------------------------------
MULTILINESTRING((1 1,2 1),(2 1,2 2))
(1 row)该文章对您有帮助吗?