STArea (geography Data Type)

Returns the total surface area of a geography instance. Results for STArea() are returned in the square of the unit of measure used by the spatial reference identifier of the geography instance; for example, if the SRID of the instance is 4326, STArea() returns results in square meters.

Syntax

.STArea ( )

Return Types

SQL Server return type: float

CLR return type: SqlDouble

Remarks

STArea() returns 0 if a geography instance contains only 0- and 1-dimensional figures, or if it is empty.

Note

Methods on the geography data type that produce a metric return value will have different results based on the SRID of the instance used in the method. For more information on SRIDs, see Spatial Reference Identifiers (SRIDs).

Examples

The following example uses STArea() to create a Polygongeography instance and computes the area of the polygon.

DECLARE @g geography;
SET @g = geography::STGeomFromText('POLYGON((-122.358 47.653, -122.348 47.649, -122.348 47.658, -122.358 47.658, -122.358 47.653))', 4326);
SELECT @g.STArea();

See Also

Other Resources