PolygonBuilder

The polygon builder object is used to create a polygon.

Since

200.1.0

Constructors

Link copied to clipboard
fun PolygonBuilder(polygon: Polygon?, block: PolygonBuilder.() -> Unit = {})

Creates a polygon builder from a polygon.

Link copied to clipboard
fun PolygonBuilder(spatialReference: SpatialReference? = null, block: PolygonBuilder.() -> Unit = {})

Creates a polygon builder.

Link copied to clipboard
fun PolygonBuilder(mutableParts: Iterable<MutablePart>, block: PolygonBuilder.() -> Unit = {})

Creates a polygon builder with a list of MutablePart.

Link copied to clipboard
fun PolygonBuilder(points: Iterable<Point>, spatialReference: SpatialReference? = null, block: PolygonBuilder.() -> Unit = {})

Creates a polygon builder with a list of points.

Inherited properties

Link copied to clipboard

The extent for the geometry in the builder. The extent for the geometry in the builder which is a envelope and contains the same spatial reference as the input geometry.

Link copied to clipboard

A value indicating whether the geometry builder currently contains any curve segments. ArcGIS software supports polygon and polyline geometries that contain curve segments (where Segment.isCurve is true, sometimes known as true curves or nonlinear segments). Curves may be present in certain types of data - for example Mobile Map Packages (MMPKs), or geometry JSON.

Link copied to clipboard

A value indicating if the geometry builder has M. If an error occurs false is returned. M is a vertex value that is stored with the geometry builder.

Link copied to clipboard

A value indicating if the geometry builder has Z. If an error occurs false is returned. Z typically represent elevations or heights.

Link copied to clipboard

Check if a geometry builder is empty or not. Only check the geometry builder to see if it is empty. Does not check the spatial reference. Returns true if an error occurs.

Link copied to clipboard

Check if a geometry builder contains sufficient points to show a valid graphical sketch. This can be used as an initial lightweight check to see if the current state of a builder produces a non-empty geometry; for example, it may be used to enable or disable functionality in an editing user interface. The exact requirements vary depending on the type of geometry produced by the builder:

Link copied to clipboard

New parts for the multipart builder. The collection of parts for the multipart builder. Changes to the collection are reflected in the multipart builder.

Link copied to clipboard

The spatial reference for the geometry. If the geometry does not have a spatial reference null is returned.

Functions

Link copied to clipboard
open override fun replaceGeometry(geometry: Polygon?)

Replaces the geometry in the builder with the new geometry. This does not update the spatial reference of the builder. If the geometry is null, the builder is cleared.

Link copied to clipboard
open override fun toGeometry(): Polygon

Creates a geometry with the values in the geometry builder.

Link copied to clipboard

Creates a polyline with the values in the polygon builder. Creates the polyline object described by this builder.

Inherited functions

Link copied to clipboard
fun addPoint(point: Point): Int
fun addPoint(x: Double, y: Double): Int
fun addPoint(x: Double, y: Double, z: Double): Int

Adds a new point to the end of the last part of the multipart. If there are no parts then an initial part is created and the point added to that. The point becomes the end point of a line segment in the part.