名稱

ST_NumCurves — 返回 CompoundCurve 中組件曲線的數量。

概要

integer ST_NumCurves(geometry a_compoundcurve);

描述

返回 CompoundCurve 中組件曲線的數量,空 CompoundCurve 返回零,非 CompoundCurve 輸入返回 NULL。

此方法實作 SQL/MM 規範。SQL-MM 3: 8.2.6, 8.3.5

此函數支援 3D,並且不會丟棄 z 索引。

範例

-- 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');