Udostępnij za pośrednictwem


STArea (geometrii typ danych)

Zwraca wartość całkowita obszar obszar powierzchni geometry wystąpienie.

.STArea ( )

Zwracane typy

SQL Server typ zwrotny: float

Zwracany typ CLR: SqlDouble

Remarks

STArea() Zwraca wartość 0, jeśli geometry wystąpienie zawiera tylko cyfry 0 i 1-wymiarowa, lub jeśli jest pusta.

Przykłady

The following example uses STArea() to create a Polygongeometry 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();

See Also

Other Resources