| title | STNumCurves (geometry Data Type) | |
|---|---|---|
| description | STNumCurves (geometry Data Type) | |
| author | MladjoA | |
| ms.author | mlandzic | |
| ms.date | 08/03/2017 | |
| ms.service | sql | |
| ms.subservice | t-sql | |
| ms.topic | reference | |
| ms.custom |
|
|
| helpviewer_keywords |
|
|
| dev_langs |
|
|
| monikerRange | =azuresqldb-current || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current || =fabric-sqldb |
[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance FabricSQLDB]
This method 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.
.STNumCurves()
[!INCLUDEssNoVersion] return type: geometry
CLR return type: SqlGeometry
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.
The following example shows how to get the number of curves in a CircularString instance:
DECLARE @g geometry;
SET @g = geometry::Parse('CIRCULARSTRING(10 0, 0 10, -10 0, 0 -10, 10 0)');
SELECT @g.STNumCurves();The following example uses STNumCurves() to return the number of curves in a CompoundCurve instance.
DECLARE @g geometry;
SET @g = geometry::Parse('COMPOUNDCURVE(CIRCULARSTRING(10 0, 0 10, -10 0, 0 -10, 10 0))');
SELECT @g.STNumCurves();Spatial Data Types Overview
OGC Methods on Geometry Instances