Tests whether a geometry is a collection type. Returns true if the geometry type is one of:
GeometryCollectionMULTI{POINT, POLYGON, LINESTRING, CURVE, SURFACE}MultiCompoundCurve
Syntax
boolean ST_IsCollection(geometry g);Parameters
| Parameter | Description |
| g | The geometry object to test. |
Usage notes
An empty
GeometryCollectionreturnstrue.Supports 3D geometries and preserves z coordinates.
Supports circular strings and curves.
Examples
Return `true` for a MULTI type:
SELECT ST_IsCollection('MULTIPOINT((1 0),(2 0))'::geometry);
st_iscollection
-----------------
t
(1 row)Return `true` for a GeometryCollection:
SELECT ST_IsCollection('GeometryCollection(POINT(1 0),POLYGON((1 0,2 0, 0 2,1 0)))'::geometry);
st_iscollection
-----------------
t
(1 row)该文章对您有帮助吗?