STNumCurves (geometry)

STNumCurves (geometry)#

Returns the number of curves in a geometry instance when the instance is a one-dimensional spatial data type. One-dimensional spatial data types include LineString, CircularString, and CompoundCurve. STNumCurves() works only on simple types; it does not work with geometry collections like MultiLineString.

Syntax#

.STNumCurves ()

Return type#

geometry

Remarks#

An empty one-dimensional geometry instance returns 0. NULL is returned when the geometry instance is not a one-dimensional instance or is an uninitialized instance.

Example#

Use STNumCurves() on a CircularString instance.

DECLARE @g geometry;
SET @g = geometry::Parse('CIRCULARSTRING(10 0, 0 10, -10 0, 0 -10, 10 0)');
SELECT @g.STNumCurves();

See Also#