GeometryBuilder class final

Geometry builders allow you to create and modify geometries incrementally.

This is the base class for a range of geometry builders, such as a PointBuilder, PolylineBuilder and PolygonBuilder. Each GeometryType has a corresponding type of builder. You can create and modify polygons with PolygonBuilder, envelopes with EnvelopeBuilder, and so on. Use a geometry builder in editing workflows where you need to build up or edit geometry one vertex at a time, for example, when you need to add or edit a vertex from a custom streaming GIS data source. You can either create an empty geometry builder and build up the shape of a Geometry, or you can create a geometry builder with an existing Geometry and modify it.

When you construct the builder, you can explicitly set its SpatialReference or you can construct the builder with a geometry and the builder will adopt the Geometry.spatialReference. Once set, the SpatialReference cannot be changed. The SpatialReference of any geometry or coordinates added to the builder must be compatible with the SpatialReference of the builder, as they will not be reprojected. The SpatialReference of a geometry added to the builder can be null, in which case the object is assumed to have the same SpatialReference as the builder it is added to.

There are other ways to create and edit geometries. If you know all the geometry coordinates up front, then you can use geometry constructors, such as Polygon, to create the geometry. If you are going to create a new geometry as a result of a topological operation, such as the buffer operation, then explore the GeometryEngine. If you want your app users to interactively create or edit geometries in the user interface then use the GeometryEditor.

Implemented types
Implementers

Properties

extent Envelope
The extent for the geometry being constructed in the geometry builder.
no setter
hasCurves bool
True if the geometry builder currently contains any curve segments, false otherwise.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasM bool
True if the geometry builder supports geometries with m values, false otherwise.
no setter
hasZ bool
True if the geometry builder supports geometries with z values, false otherwise.
no setter
isEmpty bool
True if no coordinates have been added to this geometry builder, false otherwise.
no setter
isSketchValid bool
True if the geometry builder contains sufficient points to show a valid graphical sketch, false otherwise.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
spatialReference SpatialReference?
The spatial reference for the geometry.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
replaceGeometry({required Geometry? geometry}) → void
Replaces the geometry currently stored in the geometry builder with the new geometry.
toGeometry() Geometry
Returns the geometry this geometry builder is constructing or modifying.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

createFromGeometry({required Geometry geometry}) GeometryBuilder
Creates a geometry builder with the specified geometry as a starting point for further modification.
createFromGeometryTypeAndSpatialReference({required GeometryType geometryType, required SpatialReference? spatialReference}) GeometryBuilder
Creates an empty geometry builder which builds geometries of the specified GeometryType.