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.
            
 Questo metodo implementa la specifica SQL/MM.  SQL-MM 3: 8.2.6, 8.3.5
            
 Questa funzione supporta il 3d e non distrugge gli 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');
        
      ST_CurveN, ST_Dump, ST_ExteriorRing, ST_NumInteriorRings, ST_NumGeometries