Share via


STNumPoints (geography Data Type)

Returns the total number of points in each of the figures in a geography instance.

Syntax

.STNumPoints ( )

Return Types

SQL Server return type: int

CLR return type: SqlInt32

Remarks

This method counts the points in the description of a geography instance. Duplicate points are counted. If this instance is a collection, this method returns of the total number of points in each of the elements in the collection.

Examples

The following example creates a LineString instance and uses STNumPoints() to determine how many points were used in the description of the instance.

DECLARE @g geography;
SET @g = geography::STGeomFromText('LINESTRING(-122.360 47.656, -122.343 47.656)', 4326);
SELECT @g.STNumPoints();

See Also

Other Resources