如果輸入參數類型為GeometryCollection、Multi(Point,Polygon,LineString,Curve,Surface)、CompoundCurve時,返回true。

語法

boolean  ST_IsCollection(geometry  g);

參數

參數名稱 描述
g 目標Geometry對象。

描述

  • 如果GeometryCollection為空,也將返回true。
  • 該函數支持3D對象,并且不會刪除Z坐標。
  • 該函數支持Circular Strings和Curves類型幾何對象。

示例

  • Multi對象:
    SELECT ST_IsCollection('MULTIPOINT((1 0),(2 0))'::geometry);
     st_iscollection
    -----------------
     t
    (1 row)
                        
  • GeometryCollection對象:
    SELECT ST_IsCollection('GeometryCollection(POINT(1 0),POLYGON((1 0,2 0, 0 2,1 0)))'::geometry);
     st_iscollection
    -----------------
     t
    (1 row)