ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Geometry Namespace / IGeometryEngine Interface / Boundary Method
Specifies the input geometry.
Example Version

Boundary Method (IGeometryEngine)
Calculates the boundary of the input geometry.
Syntax
Geometry Boundary( 
   Geometry geometry
)

Parameters

geometry
Specifies the input geometry.

Return Value

The geometry that represents the boundary of the input geometry. For Point - returns an empty point. For Multipoint - returns an empty point. For Envelope - returns a polyline, that bounds the envelope. For Polyline - returns a multipoint, using OGC specification (includes path endpoints, using mod 2 rule). For Polygon - returns a polyline that bounds the polygon by adding all rings of the polygon to a polyline.
Exceptions
ExceptionDescription
Geometry is null or empty.
The method is not implemented for GeometryBag.
Remarks
If the input geometry is not known-simple, then the operation will be performed on a simplified copy of the geometry.

GeometryEngine Boundary

Example
Determine the boundary of a multi-part Polygon
// create a donut polygon.  Must use the PolygonBuilderEx object

List<Coordinate2D> outerPts = new List<Coordinate2D>();
outerPts.Add(new Coordinate2D(10.0, 10.0));
outerPts.Add(new Coordinate2D(10.0, 20.0));
outerPts.Add(new Coordinate2D(20.0, 20.0));
outerPts.Add(new Coordinate2D(20.0, 10.0));

List<Coordinate2D> innerPts = new List<Coordinate2D>();
innerPts.Add(new Coordinate2D(13.0, 13.0));
innerPts.Add(new Coordinate2D(17.0, 13.0));
innerPts.Add(new Coordinate2D(17.0, 17.0));
innerPts.Add(new Coordinate2D(13.0, 17.0));

Polygon donut = null;

// add the outer points
PolygonBuilderEx pb = new PolygonBuilderEx(outerPts);
// add the inner points (note they are defined anticlockwise)
pb.AddPart(innerPts);
// get the polygon
donut = pb.ToGeometry();

// get the boundary 
Geometry g = GeometryEngine.Instance.Boundary(donut);
Polyline boundary = g as Polyline;
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also