Skip to content

Latest commit

 

History

History
67 lines (54 loc) · 2.86 KB

File metadata and controls

67 lines (54 loc) · 2.86 KB
title Point | Microsoft Docs
ms.custom
ms.date 03/14/2017
ms.prod sql-server-2016
ms.reviewer
ms.suite
ms.technology
dbe-spatial
ms.tgt_pltfrm
ms.topic article
helpviewer_keywords
Point geometry subtype [SQL Server]
geometry data type [SQL Server], spatial data
ms.assetid 2a596ec4-8b2f-4962-bcb4-e5c8f77edad5
caps.latest.revision 19
author BYHAM
ms.author rickbyh
manager jhubbard

Point

In [!INCLUDEssNoVersion] spatial data, a Point is a 0-dimensional object representing a single location and may contain Z (elevation) and M (measure) values.

Geography Data Type

The Point type for the geography data type represents a single location where Lat represents latitude and Long represents longitude. The values for latitude and longitude are measured in degrees. Values for latitude always lie in the interval [-90, 90], and values that are inputted outside this range will throw an exception. Values for longitude always lie in the interval (-180, 180], and values inputted outside this range are wrapped around to fit in this range. For example, if 190 is inputted for longitude, then it will be wrapped to the value -170. SRID represents the spatial reference ID of the geography instance that you wish to return.

Geometry Data Type

The Point type for the geometry data type represents a single location where X represents the X-coordinate of the Point being generated and Y represents the Y-coordinate of the Point being generated. SRID represents the spatial reference ID of the geometry instance that you wish to return.

Examples

The following example creates a geometry Pointinstance representing the point (3, 4) with an SRID of 0.

DECLARE @g geometry;  
SET @g = geometry::STGeomFromText('POINT (3 4)', 0);  

The next example creates a geometry``Point instance representing the point (3, 4) with a Z (elevation) value of 7, an M (measure) value of 2.5, and the default SRID of 0.

DECLARE @g geometry;  
SET @g = geometry::Parse('POINT(3 4 7 2.5)');  

The final example returns the X, Y, Z, and M values for the geometry``Point instance.

SELECT @g.STX;  
SELECT @g.STY;  
SELECT @g.Z;  
SELECT @g.M;  

Z and M values may be explicitly specified as NULL, as shown in the following example.

DECLARE @g geometry;  
SET @g = geometry::Parse('POINT(3 4 NULL NULL)');  

See Also

MultiPoint
STX (geometry Data Type)
STY (geometry Data Type)
Spatial Data (SQL Server)