EnvelopeBuilder

The envelope builder allows you to create and modify envelope geometries incrementally. Envelope geometries are immutable and cannot be changed directly once created. Use the constructors to define minimum and maximum x,y coordinates, z and m values, and a SpatialReference. Once set, the SpatialReference cannot be changed. Use GeometryBuilder.toGeometry to return the new Envelope from the builder.

Since

200.1.0

Constructors

Link copied to clipboard
constructor(envelope: Envelope?, block: EnvelopeBuilder.() -> Unit = {})

Creates an envelope builder from the specified Envelope.

constructor(spatialReference: SpatialReference? = null, block: EnvelopeBuilder.() -> Unit = {})

Creates an envelope builder.

constructor(center: Point, width: Double, height: Double, depth: Double? = null, block: EnvelopeBuilder.() -> Unit = {})

Creates an envelope builder from a center point, width, height, depth, and configuration lambda.

Properties

Link copied to clipboard

The center point of the Envelope being constructed.

Link copied to clipboard

The depth of the Envelope being constructed or null if the builder does not have z-values.

Link copied to clipboard

The height of the Envelope being constructed. This is the difference between the minimum and maximum y coordinates.

Link copied to clipboard

The m maximum value of the Envelope being constructed. Returns NAN if an error occurs.

Link copied to clipboard

The m minimum value of the Envelope being constructed. Returns NAN if an error occurs.

Link copied to clipboard

The width of the Envelope being constructed. This is the difference between the minimum and maximum x coordinates.

Link copied to clipboard

The x maximum value of the Envelope being constructed. Returns NAN if an error occurs.

Link copied to clipboard

The x minimum value of the Envelope being constructed. Returns NAN if an error occurs.

Link copied to clipboard

The y maximum value of the Envelope being constructed. Returns NAN if an error occurs.

Link copied to clipboard

The y minimum value of the Envelope being constructed. Returns NAN if an error occurs.

Link copied to clipboard

The z maximum value of the Envelope being constructed. Returns NAN if an error occurs.

Link copied to clipboard

The z minimum value of the Envelope being constructed. Returns NAN if an error occurs.

Inherited properties

Link copied to clipboard

The extent for the geometry being constructed in the geometry builder.

Link copied to clipboard

True if the geometry builder currently contains any curve segments, false otherwise. 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, such as Mobile Map Packages (MMPKs), or geometry JSON.

Link copied to clipboard

True if the geometry builder supports geometries with m values, false otherwise. M values are often referred to as measures, and are used in linear referencing workflows on linear datasets. NaN is a valid m value. If true, m values are stored for each vertex of the constructed Geometry. Geometries with m values are created by using setters or constructors that take an m value as a parameter.

Link copied to clipboard

True if the geometry builder supports geometries with z values, false otherwise. Z values are generally used as a z coordinate, indicating height or elevation. NaN is a valid z value. If true, z values are stored for each vertex of the constructed Geometry. Geometries with z values are created by using setters or constructors that take a z value as a parameter.

Link copied to clipboard

True if no coordinates have been added to this geometry builder, false otherwise. An empty geometry builder may have a valid SpatialReference, even without coordinates.

Link copied to clipboard

True if the geometry builder contains sufficient points to show a valid graphical sketch, false otherwise. 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

The spatial reference for the geometry. Once set, the SpatialReference of the geometry builder cannot be changed. Ensure that all objects added to the builder have a compatible SpatialReference.

Functions

Link copied to clipboard
fun centerAt(point: Point)

Centers the envelope at the specified point. The point's spatial reference must be the same as the envelope builder's.

Link copied to clipboard
fun changeAspectRatio(width: Double, height: Double)

Adjust the envelope's aspect ratio to match the ratio of the given width and height. The operation preserves the center of the envelope and only increases either height or width, not both. If the new width would be greater than the old, the width is changed and the height remains the same. If the new width would be less than or equal to the old, the height is changed and the width remains the same.

Link copied to clipboard
fun expand(factor: Double)

Expands the envelope by the given scale factor. A factor of less than 1.0 shrinks the envelope and greater than 1.0 expands it. The envelope's center remains unchanged, but its corners change.

fun expand(anchor: Point, factor: Double)

Expands the envelope at the anchor point by the given factor. A factor of less than 1.0 shrinks the envelope and greater than 1.0 expands it.

Link copied to clipboard
fun offsetBy(x: Double, y: Double)

Moves the builder's envelope geometry by the given offsets in the x and y dimension.

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

Replaces the geometry currently stored in the geometry builder with the new geometry. This method can be used as an alternative to creating a new builder from an existing geometry. Note that this does not update the spatial reference of the builder and the builder geometry is cleared if the geometry is null. Geometries with curves are supported.

Link copied to clipboard
fun setM(mMin: Double, mMax: Double)

Set the m-values for the envelope.

Link copied to clipboard
fun setXy(xMin: Double, yMin: Double, xMax: Double, yMax: Double)

Set the x,y coordinates for the envelope.

Link copied to clipboard
fun setZ(zMin: Double, zMax: Double)

Set the z-values for the envelope.

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

Returns Geometry that the geometry builder is constructing or modifying.

Link copied to clipboard
fun union(envelope: Envelope)

Finds the union of the builder's envelope and the specified envelope and updates the envelope builder with the result.

fun union(point: Point)

Finds the union of the builder's envelope and the specified point and updates the envelope builder with the result.