Boundary Method (GeometryEngine)
Calculates the boundary of the input 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.
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;
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.