Name

ST_IsCollection — Tests if a geometry is a geometry collection type.

Synopsis

boolean ST_IsCollection(geometry g);

Description

Returns TRUE if the geometry type of the argument a geometry collection type. Collection types are the following:

  • GEOMETRYCOLLECTION

  • MULTI{POINT,POLYGON,LINESTRING,CURVE,SURFACE}

  • COMPOUNDCURVE

[Note]

This function analyzes the type of the geometry. This means that it will return TRUE on collections that are empty or that contain a single element.

This function supports 3d and will not drop the z-index.

This method supports Circular Strings and Curves.

Examples

postgis=# SELECT ST_IsCollection('LINESTRING(0 0, 1 1)'::geometry);
 st_iscollection
-------------
 f
(1 row)

postgis=# SELECT ST_IsCollection('MULTIPOINT EMPTY'::geometry);
 st_iscollection
-------------
 t
(1 row)

postgis=# SELECT ST_IsCollection('MULTIPOINT((0 0))'::geometry);
 st_iscollection
-------------
 t
(1 row)

postgis=# SELECT ST_IsCollection('MULTIPOINT((0 0), (42 42))'::geometry);
 st_iscollection
-------------
 t
(1 row)

postgis=# SELECT ST_IsCollection('GEOMETRYCOLLECTION(POINT(0 0))'::geometry);
 st_iscollection
-------------
 t
(1 row)

See Also

ST_NumGeometries