Show / Hide Table of Contents

Class PolygonBuilder

Builder for creating Polygon instances.

Inheritance
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
GeometryBuilder<Polygon>.ToGeometry()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Esri.ArcGISRuntime.Geometry
Assembly: Esri.ArcGISRuntime.dll
Syntax
public sealed class PolygonBuilder : MultipartBuilder<Polygon>
Remarks

Use the PolygonBuilder Class to create and/or modify a Polygon shape. The builder is best suited for editing workflows where the user may be adding, inserting or removing parts of a Polygon geometry interactively. Polygons are based upon the parent Geometry Class. The Geometry Class is immutable which means that you can not change its shape once it is created. Hence the PolygonBuilder provides the way to make changes when working with a Polygon. Use the ToGeometry() Method to get the Polygon geometry from the builder.

A polygon is a closed shape defined by one or more parts 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 the Simplify(Geometry) method to correct any issues. This is especially true if you pass a polygon to ArcGIS Server for a geoprocessing task to avoid any ArcGIS Server errors being thrown.

Constructors

Name Description
PolygonBuilder(Polygon)

Initializes a new instance of the PolygonBuilder class from a polygon.

PolygonBuilder(SpatialReference)

Initializes a new instance of the PolygonBuilder class.

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
ToPolyline()

Creates a polyline with the values in the polygon builder.

Applies to

TargetVersions
.NET Standard 2.0100.3 - 200.0
.NET 6.0100.13 - 200.0
.NET 6.0 Windows100.13 - 200.0
.NET 6.0 Android200
.NET 6.0 iOS200
.NET Framework100.0 - 200.0
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Android100.0 - 100.15
iOS100.0 - 100.15
UWP100.0 - 200.0

Relevant samples

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