Name

ST_CollectionHomogenize — Given a geometry collection, returns the "simplest" representation of the contents.

Synopsis

geometry ST_CollectionHomogenize(geometry collection);

Description

Given a geometry collection, returns the "simplest" representation of the contents. Singletons will be returned as singletons. Collections that are homogeneous will be returned as the appropriate multi-type.

[Warning]

When a multipolygon is returned the multipolygon may have shared edges. This results in an invalid multipolygon.

Availability: 2.0.0

Examples

  SELECT ST_AsText(ST_CollectionHomogenize('GEOMETRYCOLLECTION(POINT(0 0))'));	

	st_astext
	------------
	 POINT(0 0)
	(1 row)

  SELECT ST_AsText(ST_CollectionHomogenize('GEOMETRYCOLLECTION(POINT(0 0),POINT(1 1))'));	

	st_astext
	---------------------
	 MULTIPOINT(0 0,1 1)
	(1 row)

				

See Also

ST_Multi, ST_CollectionExtract