Name

ST_NumCurves — Return the number of component curves in a CompoundCurve.

Synopsis

integer ST_NumCurves(geometry a_compoundcurve);

描述

Return the number of component curves in a CompoundCurve, zero for an empty CompoundCurve, or NULL for a non-CompoundCurve input.

该方法实现了SQL/MM规范。 SQL-MM 3: 8.2.6, 8.3.5

该函数支持 3d 并且不会丢失 z-index。

示例

-- Returns 3
SELECT ST_NumCurves('COMPOUNDCURVE(
    (2 2, 2.5 2.5),
    CIRCULARSTRING(2.5 2.5, 4.5 2.5, 3.5 3.5),
    (3.5 3.5, 2.5 4.5, 3 5, 2 2)
  )');

-- Returns 0
SELECT ST_NumCurves('COMPOUNDCURVE EMPTY');