Querying Properties and Behaviors of geography Instances

All geography instances have a number of properties that can be retrieved through methods that SQL Server provides. The following topics define the properties and behaviors of geography types, and the methods for querying each one.

Number of Points

All nonempty geography instances are comprised of points. These points represent the latitude and longitude coordinates of the earth on which the geography instances are drawn. The data type geography provides numerous built-in methods for querying the points of an instance.

To return the number of points that comprise an instance

To return a specific point in an instance

To return the start point of an instance

To return the end point of an instance

Dimension

A nonempty geography instance can be 0-, 1-, or 2-dimensional. Zero-dimensional geography instances, such as Point and MultiPoint, have no length or area. One-dimensional objects, such as LineString and MultiLineString, have length. Two-dimensional instances, such as Polygon and MultiPolygon, have area and length. Empty instances report a dimension of -1, and a GeometryCollection reports the maximum dimension of its contents.

To return the dimension of an instance

To return the length of an instance

To return the area of an instance

Empty

An emptygeography instance does not have any points. The length of empty LineString and MultiLineString instances is 0. The area of empty Polygon and MultiPolygon instances is 0.

To determine if an instance is empty

Closure

A closedgeography instance is a figure whose start points and end points are the same. Polygon instances are considered closed. Point instances are not closed.

A ring is a simple, closed LineString instance.

To determine if an instance is closed

STIsClosed (geography Data Type)

To return the number of rings in a Polygon instance

NumRings (geography Data Type)

To return a specified ring of a geography instance

RingN (geography Data Type)

Spatial Reference ID (SRID)

The spatial reference ID (SRID) is an identifier specifying which ellipsoidal coordinate system the geography instance is represented in. Two geography instances with different SRIDs cannot be compared.

To set or return the SRID of an instance

STSrid (geography Data Type)

This property can be modified.