ST_NumCurves — Return the number of component curves in a CompoundCurve.
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.
This method implements the SQL/MM specification.
SQL-MM 3: 8.2.6, 8.3.5
This function supports 3d and will not drop the z-index.
This CompoundCurve contains three component curves.
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
An empty CompoundCurve has no component curves.
SELECT ST_NumCurves('COMPOUNDCURVE EMPTY');
0
ST_CurveN, ST_Dump, ST_ExteriorRing, ST_NumInteriorRings, ST_NumGeometries