Show / Hide Table of Contents

Class PolygonBuilder

Builder for creating and modifying Polygon geometries incrementally.

Inheritance
System.Object
GeometryBuilder<Polygon>
MultipartBuilder<Polygon>
PolygonBuilder
MultipartBuilder<Polygon>.Parts
MultipartBuilder<Polygon>.AddPoint(MapPoint)
MultipartBuilder<Polygon>.AddPoint(Double, Double)
MultipartBuilder<Polygon>.AddPoint(Double, Double, Double)
MultipartBuilder<Polygon>.AddPoints(IEnumerable<MapPoint>)
MultipartBuilder<Polygon>.AddPart(IEnumerable<MapPoint>)
MultipartBuilder<Polygon>.AddPart(IEnumerable<Segment>)
MultipartBuilder<Polygon>.AddParts(IEnumerable<IEnumerable<Segment>>)
MultipartBuilder<Polygon>.ReplaceGeometry(Polygon)
GeometryBuilder<Polygon>.SpatialReference
GeometryBuilder<Polygon>.Extent
GeometryBuilder<Polygon>.HasM
GeometryBuilder<Polygon>.HasZ
GeometryBuilder<Polygon>.IsEmpty
GeometryBuilder<Polygon>.IsSketchValid
GeometryBuilder<Polygon>.HasCurves
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Esri.ArcGISRuntime.Geometry
Assembly: Esri.ArcGISRuntime.dll
Syntax
public sealed class PolygonBuilder : MultipartBuilder<Polygon>
Remarks

Polygon geometries are immutable and cannot be changed directly once created. A polygon is a closed area shape defined by one or more parts. Each part in a polygon is a connected sequence of Segment instances that start and end at the same point (a closed ring). If a polygon has more than one ring, the rings may be separate from one another or they may nest inside one another, but they should not overlap. Note: interior rings, to make donut polygons, should be counter-clockwise in direction to be topology correct. If there is ever a doubt about the topological correctness of a polygon, call Simplify(Geometry) to correct any issues.

The polygon builder allows you to change the contents of the shape using the collection that you can access from the Parts property. Each Part in this collection comprises a collection of segments that define the Polygon. You can add or remove a Part from the parts collection, or you can create or edit segment vertices of an existing Part. Use ToGeometry() to return the new Polygon from the builder.

Constructors

Name Description
PolygonBuilder(Polygon)

Initializes a new instance of the PolygonBuilder class by copying the parts from the specified Polygon.

PolygonBuilder(SpatialReference)

Initializes a new instance of the PolygonBuilder class with the specified SpatialReference.

PolygonBuilder(IEnumerable<MapPoint>, SpatialReference)

Initializes a new instance of the PolygonBuilder class.

PolygonBuilder(IEnumerable<Segment>, SpatialReference)

Initializes a new instance of the PolygonBuilder class.

PolygonBuilder(IEnumerable<IEnumerable<MapPoint>>, SpatialReference)

Initializes a new instance of the PolygonBuilder class.

PolygonBuilder(IEnumerable<IEnumerable<Segment>>, SpatialReference)

Initializes a new instance of the PolygonBuilder class.

Methods

Name Description
ToGeometry()

Returns the Geometry this geometry builder is constructing or modifying.

ToPolyline()

Creates a polyline with the values in the polygon builder.

Applies to

TargetVersions
.NET Standard 2.0100.3 - 200.8
.NET100.13 - 200.8
.NET Windows100.13 - 200.8
.NET Android200.0 - 200.8
.NET iOS200.0 - 200.8
.NET Framework100.0 - 200.8
Xamarin.Android100.0 - 100.15
Xamarin.iOS100.0 - 100.15
UWP100.0 - 200.8

Relevant samples

Identify graphics: Display an alert message when a graphic is clicked.
In This Article
Back to top Copyright © 2022 Esri.