Export (0) Print
Expand All
Expand Minimize

STArea (geometry Data Type)

Applies To: SQL Server 2014, SQL Server 2016 Preview

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Returns the total surface area of a geometry instance.

.STArea ( )

SQL Server return type: float

CLR return type: SqlDouble

STArea() returns 0 if a geometry instance contains only 0- and 1-dimensional figures, or if it is empty. STArea() returns NULL if the geometry instance has not been initialized.

A. Computing the area of a Polygon instance

The following example creates a Polygon geometry instance and computes the area of the polygon.

DECLARE @g geometry;
SET @g = geometry::STGeomFromText('POLYGON((0 0, 3 0, 3 3, 0 3, 0 0),(2 2, 2 1, 1 1, 1 2, 2 2))', 0);
SELECT @g.STArea();

B. Computing the area of a CurvePolygon instance

The following example computes the area of a CurvePolygon instance.

DECLARE @g geometry;

SET @g = geometry::Parse('CURVEPOLYGON(CIRCULARSTRING(0 2, 2 0, 4 2, 4 2, 0 2))');

SELECT @g.STArea() AS Area;

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2015 Microsoft