TechNet
Export (0) Print
Expand All

STArea (geography Data Type)

 

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)yesAzure SQL DatabasenoAzure SQL Data Warehouse noParallel 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.

  
.STArea ( )  

SQL Server return type: float

CLR return type: SqlDouble

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

System_CAPS_ICON_note.jpg 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).

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();  

OGC Methods on Geography Instances

Community Additions

ADD
Show:
© 2016 Microsoft