title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | f1_keywords | helpviewer_keywords | dev_langs | monikerRange | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
STBoundary (geometry Data Type) |
STBoundary (geometry Data Type) |
MladjoA |
mlandzic |
03/14/2017 |
sql |
t-sql |
reference |
|
|
|
=azuresqldb-current||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current |
[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance]
Returns the boundary of a geometry instance.
.STBoundary ( )
[!INCLUDEssNoVersion] 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.
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();
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();
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();