ArcGIS Developers

GeometryBuilder QML Type

Base type for types used to create immutable geometries. More...

Import Statement: import Esri.ArcGISRuntime 100.11
Since: Esri.ArcGISRuntime 100.0


Inherited By:

EnvelopeBuilder, MultipartBuilder, MultipointBuilder, and PointBuilder



Detailed Description

Note: You cannot declare or create a component of this type in QML code.

Each type of Geometry has a corresponding builder type. For example, PolygonBuilder creates Polygons and EnvelopeBuilder creates Envelopes. Create a new empty builder in order to build up the shape of a geometry step by step. Alternatively for editing workflows, initialize the builder by passing the existing Geometry to be edited into the builder constructor, and then make the required changes. In both cases, call toGeometry to return a new immutable Geometry based on the current state of the geometry in the builder.

Set the spatial reference of a builder either explicitly by specifying a SpatialReference object in the constructor, or is set implicitly from other constructor arguments. Once set, the spatial reference cannot be changed. When building geometries, the spatial reference of any objects or coordinates added to the builder must be compatible with the spatial reference of the builder; added items are not reprojected. The spatial reference of added objects may be null, in which case the added object is assumed to have the same spatial reference as the builder it is added to.

A number of other methods provide information about the geometry currently being constructed. A new builder will be empty (empty is true). The hasZ and hasM methods indicate if the builder allows adding z and m-values for each coordinate in the geometry.

This QML type supports the following default properties. A default property may be declared inside another declared object without being assigned explicitly to a property.

TypeDefault Property

Property Documentation

empty : bool

Returns whether the geometry being built is currently empty (read-only).

extent : extent

Returns the extent (read-only).

geometry : Geometry

The Geometry this builder operates on.

You can get the geometry at any time by using this property.

You can reset the geometry in this builder by assigning a geometry to this property. However, you cannot change the geometry type for a builder by assigning a different type of geometry. For example you cannot assign a Polygon to a PointBuilder.

You may also set the geometry property to null which will reset it to an empty geometry. Note that it will not return null after that but rather a valid geometry with the empty property true. Setting the geometry to null will not change the spatial reference property.

geometryBuilderType : Enums.GeometryBuilderType

Returns the Enums.GeometryBuilderType (read-only).

hasM : bool

Returns whether the geometry has m-values (read-only).

hasZ : bool

Returns whether the geometry has z-coordinates (read-only).

sketchValid : bool

Returns whether the builder's geometry contains sufficient points to show a valid graphical sketch (read-only).

This can be used as an initial lightweight check to see if the current state of a builder will produce 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:

Note that this is not equivalent to topological simplicity, which is enforced by GeometryEngine::simplify(geometry) and checked using GeometryEngine::isSimple(geometry). Geometries must be topologically simple to be successfully saved in a geodatabase, or used in some service operations.

[default] spatialReference : SpatialReference

The spatial reference.

Signal Documentation


Emitted when any property inherited from GeometryBuilder changes.

Note: The corresponding handler is onGeometryChanged.


Emitted when the spatialReference property changes.

Note: The corresponding handler is onSpatialReferenceChanged.

Feedback on this topic?