STArea (geography Data Type)

**APPLIES TO:** ![yes](media/yes.png)SQL Server (starting with 2008) ![yes](media/yes.png)Azure SQL Database ![no](media/no.png)Azure SQL Data Warehouse ![no](media/no.png)Parallel Data Warehouse

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 Polygon``geography 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

OGC Methods on Geography Instances