名前

ST_NumCurves — 複合曲線内の曲線の数を返します。

概要

integer ST_NumCurves(geometry a_compoundcurve);

説明

複合曲線内の曲線の数を返します。入力が空の複合曲線の場合には0を返し、複合曲線でない場合にはNULLを返します。

このメソッドはSQL/MM仕様の実装です。 SQL-MM 3: 8.2.6, 8.3.5

この関数は3次元に対応し、Z値を削除しません。

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