Name

ST_IsCollection — 测试几何图形是否为几何图形集合类型。

Synopsis

boolean ST_IsCollection(geometry g);

描述

退货 TRUE 如果参数的几何类型为几何集合类型。集合类型如下:

  • GEOMETRYCOLLECTION

  • 多个{点、面、直线、曲线、曲面}

  • COMPOUNDCURVE

[Note]

此函数用于分析几何图形的类型。这意味着它将返回 TRUE 在为空或包含单个元素的集合上。

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

This method supports Circular Strings and Curves

示例

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)

另请参阅

ST_NumGeometries