Dec
15

SQL Server 2008 R2 Spatial Data Notes

Building a Point
A point in SQL Server is represented as Longitude and then Latitude
geography::STPointFromText(‘POINT(‘ + CAST([Longitude] AS VARCHAR(20)) + ‘ ‘ + CAST([Latitude] AS VARCHAR(20)) + ‘)’, 4326)

Ring Orientation
A ring is a collection of points that make up a polygon. A ring either defines an area inside or outside of the polygon. Defining the points of a ring in a counter-clockwise manner means you want to include everything within the ring. Defining the ring in a clockwise pattern means you want to include everything outside the ring.

Hemispheres
You cannot cross hemispheres when defining a polygon. This includes the Northern/Southern hemispheres as well as the hemispheres defined as East/West of the Prime Meridian.

Longitude
Longitude is defined as numbers between -180 and +180

Latitude
Latitude is defined as numbers between -90 and +90

Leave a comment

Knowledge Bomb