STBoundary (geometry)

STBoundary (geometry)#

Returns the boundary of a geometry instance.

Syntax#

.STBoundary ()

Return type#

geometry

Remarks#

STBoundary() returns an empty GeometryCollection when the endpoints for a LineString, CircularString, or CompoundCurve instance are the same.

Example#

Create a LineString geometry instance. STBoundary() returns the boundary of the LineString.

DECLARE @g geometry;
SET @g = geometry::STGeomFromText('LINESTRING(0 0, 2 2, 0 2, 2 0)', 0);
SELECT @g.STBoundary().ToString();

See Also#