STBoundary (geometry Data Type)

 

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Returns the boundary of a geometry instance.

  
.STBoundary ( )  

SQL Server return type: geometry

CLR return type: SqlGeometry

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

A. Using STBoundary() on a LineString instance with different endpoints

The following example creates 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();  

B. Using STBoundary() on a LineString instance with the same endpoints

The following example creates a valid LineString instance with the same endpoints. STBoundary() returns an empty GeometryCollection.

DECLARE @g geometry;

SET @g = geometry::STGeomFromText('LINESTRING(0 0, 2 2, 0 2, -2 2, 0 0)', 0);

SELECT @g.STBoundary().ToString();

C. Using STBoundary() on a CurvePolygon instance

The following example uses STBoundary() on a CurvePolygon instance. STBoundary() returns a CircularString instance.

DECLARE @g geometry;

SET @g = geometry::STGeomFromText('CURVEPOLYGON(CIRCULARSTRING(0 0, 2 2, 0 2, -2 2, 0 0))', 0);

SELECT @g.STBoundary().ToString();

OGC Methods on Geometry Instances

Community Additions

ADD
Show: