名称

ST_NumCurves — 返回复合曲线中的曲线数量。

大纲

integer ST_NumCurves(geometry a_compoundcurve);

描述

返回复合曲线中的曲线数量。如果输入为空的复合曲线,则返回0;如果不是复合曲线,则返回NULL。

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

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

示例

This CompoundCurve contains three component curves.

Code
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)
  )');
栅格输出
3
Figure
Geometry figure for visual-st-numcurves-01

An empty CompoundCurve has no component curves.

Code
SELECT ST_NumCurves('COMPOUNDCURVE EMPTY');
栅格输出
0