GeometryBuilder QML Type

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

Import Statement: import Esri.ArcGISRuntime 100.15
Since: Esri.ArcGISRuntime 100.0
Inherits:

Object

Inherited By:

EnvelopeBuilder, MultipartBuilder, MultipointBuilder, and PointBuilder

Properties

Signals

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
SpatialReferencespatialReference

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).


hasCurves : bool

A value indicating whether the geometry builder currently contains any curve segments (read-only).

The ArcGIS Platform supports polygon and polyline geometries that contain (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.

Prior to Esri.ArcGISRuntime 100.12, only LineSegment instances were supported when creating new geometries using a MultipartBuilder. Attempting to add curve geometries to a MultipartBuilder would cause an error.

From Esri.ArcGISRuntime 100.12, you can use curves in a MultipartBuilder. New segment types CubicBezierSegment and EllipticArcSegment represent different types of curve that can be added to polygon and polyline geometries.

This property was introduced in Esri.ArcGISRuntime 100.12.

See also Part::hasCurves, Geometry::hasCurves, and Segment::isCurve.


hasM : bool

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


hasZ : bool

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


sketchValid : bool

Check if a geometry builder 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 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:

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.

Does not check the spatial reference. Returns false if an error occurs.

Prior to Esri.ArcGISRuntime 100.8, only one part of a multipart polygon or polyline was required to have the minimum number (2 for a polyline, 3 for a polygon) of Points, and only LineSegment instances were supported in builders.

Prior to Esri.ArcGISRuntime 100.12, a PolygonBuilder required at least three valid Points in each Part, and at least one Part.


[default] spatialReference : SpatialReference

The spatial reference.


Signal Documentation

geometryChanged()

Emitted when any property inherited from GeometryBuilder changes.

Note: The corresponding handler is onGeometryChanged.


spatialReferenceChanged()

Emitted when the spatialReference property changes.

Note: The corresponding handler is onSpatialReferenceChanged.


Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.