PolygonBuilder class final
The polygon builder allows you to create and modify Polygon geometries incrementally.
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 GeometryEngine.simplify to correct any issues.
The polygon builder allows you to change the contents of the shape using the MutablePartCollection that you can access from the MultipartBuilder.parts. Each MutablePart, in this MutablePartCollection, comprises a collection of segments that make edges of the MutablePart. You can add or remove a MutablePart from the MutablePartCollection, or you can create a new or edit the segment vertices of an existing MutablePart. Use GeometryBuilder.toGeometry to return the new Polygon from the builder.
- Inheritance
-
- Object
- GeometryBuilder
- MultipartBuilder
- PolygonBuilder
Constructors
- PolygonBuilder({SpatialReference? spatialReference})
-
Creates a new empty polygon builder with the specified SpatialReference.
factory
- PolygonBuilder.fromPolygon(Polygon polygon)
-
Creates a new polygon builder by copying the parts from the specified
Polygon.
factory
Properties
- extent → Envelope
-
The extent for the geometry being constructed in the geometry builder.
no setterinherited
- hasCurves → bool
-
True if the geometry builder currently contains any curve segments, false
otherwise.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasM → bool
-
True if the geometry builder supports geometries with m values, false
otherwise.
no setterinherited
- hasZ → bool
-
True if the geometry builder supports geometries with z values, false
otherwise.
no setterinherited
- isEmpty → bool
-
True if no coordinates have been added to this geometry builder, false
otherwise.
no setterinherited
- isSketchValid → bool
-
True if the geometry builder contains sufficient points to show a valid
graphical sketch, false otherwise.
no setterinherited
- parts ↔ MutablePartCollection
-
New parts for the multipart builder.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spatialReference → SpatialReference?
-
The spatial reference for the geometry.
no setterinherited
Methods
-
addPoint(
ArcGISPoint point) → int -
Adds a new point to the end of the last part of the multipart.
inherited
-
addPointXY(
{required double x, required double y}) → int -
Adds a new point to the end of the last part of the multipart.
inherited
-
addPointXYZ(
{required double x, required double y, required double z}) → int -
Adds a new point to the end of the last part of the multipart.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
replaceGeometry(
Geometry? geometry) → void -
Replaces the geometry currently stored in the geometry builder with the
new geometry.
inherited
-
toGeometry(
) → Geometry -
Returns Geometry that the geometry builder is constructing or modifying.
inherited
-
toPolyline(
) → Polyline - Creates a polyline with the values in the polygon builder.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited