Skip to content

Latest commit

 

History

History
68 lines (51 loc) · 2.23 KB

stnumcurves-geography-data-type.md

File metadata and controls

68 lines (51 loc) · 2.23 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic ms.custom f1_keywords helpviewer_keywords dev_langs
STNumCurves (geography Data Type)
STNumCurves (geography Data Type)
MladjoA
mlandzic
03/14/2017
sql
t-sql
reference
ignite-2024
STNumCurves
STNumCurves_TSQL
STNumCurves method (geography)
TSQL

STNumCurves (geography Data Type)

[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance FabricSQLDB]

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

Syntax

  
.STNumCurves()  

Return Types

[!INCLUDEssNoVersion] return type: geography

CLR return type: SqlGeography

Remarks

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.

Examples

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();

See Also

Spatial Data Types Overview
OGC Methods on Geography Instances