PointBuilder

The point builder allows you to create and modify point geometries incrementally. Point geometries are immutable and cannot be changed directly once created. The PointBuilder has a number of constructors to allow you to create a new point, or you can edit an existing point using PointBuilder.setXy(Double, Double) or PointBuilder.offsetBy(Double, Double). Use GeometryBuilder.toGeometry() to return the new Point from the builder.

Since

200.1.0

Constructors

Link copied to clipboard
constructor(point: Point?, block: PointBuilder.() -> Unit = {})

Creates a point builder from the specified point.

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

Creates an empty point builder with the specified SpatialReference.

Properties

Link copied to clipboard
var m: Double

The m-value for the point. Will return NAN if an error occurs.

Link copied to clipboard
var x: Double

The x-coordinate for the point. Will return NAN if an error occurs.

Link copied to clipboard
var y: Double

The y-coordinate for the point. Will return NAN if an error occurs.

Link copied to clipboard
var z: Double

The z-coordinate for the point. The minimum z-coordinate is -6,356,752 meters, which is the approximate radius of the earth (the WGS 84 datum semi-minor axis). The maximum z-coordinate is 55,000,000 meters. Will return 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 offsetBy(offsetX: Double, offsetY: Double)

Offsets the point by the given offsets for the x and y dimension.

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

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 setXy(x: Double, y: Double)

Sets the x,y coordinates of a point.

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

Returns the geometry this geometry builder is constructing or modifying.