Export (0) Print
Expand All

STNumCurves (geography Data Type)

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Returns the number of curves in a one-dimensional geography instance.

.STNumCurves()

SQL Server return type: geography

CLR return type: SqlGeography

One-dimensional spatial data types include LineString, CircularString, and CompoundCurve. An empty one-dimensional geography instance returns 0.

STNumCurves() works only on simple types; it does not work with geography collections like MultiLineString. NULL is returned when the geography instance is not a one-dimensional data type.

Null is returned for uninitialized geography instances.

A. Using STNumCurves() on a CircularString instance

The following example shows how to get the number of curves in a CircularString instance:

DECLARE @g geography;

SET @g = geography::Parse('CIRCULARSTRING(-122.358 47.653, -122.348 47.649, -122.348 47.658, -122.358 47.658, -122.358 47.653)');

SELECT @g.STNumCurves();

B. Using STNumCurves() on a CompoundCurve instance

The following example uses STNumCurves() to return the number of curves in a CompoundCurve instance.

DECLARE @g geography;

SET @g = geography::Parse('COMPOUNDCURVE(CIRCULARSTRING(-122.358 47.653, -122.348 47.649, -122.348 47.658, -122.358 47.658, -122.358 47.653))');

SELECT @g.STNumCurves();

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2015 Microsoft