Skip To Content ArcGIS for Developers Sign In Dashboard

Geometry QML Type

Base type for types that represent geometric shapes. More...

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

Object

Inherited By:

Envelope, Multipart, Multipoint, and Point

Properties

Signals

Methods

Detailed Description

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

This type is the base type for two-dimensional (x,y) or three-dimensional (x,y,z) geometries such as Point and Polyline objects. Objects that inherit from the Geometry type may also include an m (measure) value for each vertex.

Geometries are used throughout the API, for example to define the shape of a feature or graphic, the extent of a layer, or as inputs and outputs of different types of task.

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

Spatial references

A SpatialReference is required for all geometries. However, due to QML's declarative nature and lack of constructors, this cannot be enforced. There are some cases where geometries without a valid SpatialReference will display correctly on the map (for example, if a Point's x,y-coordinate happen to be in the same SpatialReference as the GraphicsLayer and Map). However, this would be considered a coincidence. It is not recommended nor supported, as any operation performed on the geometry, such as a geometry operation, will return geometries that do not contain a valid SpatialReference.

Coordinate units

Geometries describe geographic objects using the specific coordinate system provided as its SpatialReference. The SpatialReference may be null. Graphics that have geometries with null SpatialReference will be treated as if they have the same SpatialReference as the containing MapView; if the coordinates are in a different SpatialReference, the graphics may not display in the correct location, or at all.

Dimension

Every non-empty Geometry has an inherent dimension (sometimes called the topological dimensionality) that indicates the general class of the Geometry.

  • 0 - points and multipoints
  • 1 - lines and polylines
  • 2 - polygons and envelopes
  • 3 - objects with volume

Serializing to JSON

Geometries can be serialized and de-serialized to and from JSON. The ArcGIS REST API documentation describes the JSON representation of geometry objects. You can use this encoding and decoding mechanism to exchange geometries with REST Web services or to store them in text files.

Valid polygons have at least three vertices, and valid polylines, two vertices. When there are not enough of them, JSON serialization copies existing vertices to reach the minimum vertex count. This results in invalid (degenerate) geometries that can be parsed as the valid JSON for those geometry types.

See also JsonSerializable.

Property Documentation

dimension : int

Returns the topological dimensionality of this Geometry (read-only).

Every non-empty Geometry has an inherent dimension (sometimes called the topological dimensionality) that indicates the general class of the Geometry.

  • 0 - points and multipoints
  • 1 - lines and polylines
  • 2 - polygons and envelopes
  • 3 - objects with volume

empty : bool

Returns true if this Geometry is empty (read-only).


extent : Envelope

Returns the extent of this Geometry expressed as an Envelope (read-only).


geometryType : Enums.GeometryType

Returns the Enums.GeometryType of this geometry (read-only).


hasCurves : bool

Returns true if this geometry has curves (read-only).


hasM : bool

Returns true if the vertices of this Geometry includes z-coordinates (read-only).


hasZ : bool

Returns true if the vertices of this Geometry includes m-values (read-only).


json : jsobject

The JSON representation of this object.


[default] spatialReference : SpatialReference

The spatial reference of this Point.


unknownJson : jsobject

Returns the unknown JSON from the source JSON.

See also JsonSerializable.


unsupportedJson : jsobject

Returns the unsupported data from the source JSON.

See also JsonSerializable.


Signal Documentation

emptyChanged()

Emitted when the empty property changes.

Note: This signal will only be emitted when the property initializes during the instantiation of the component.

This QML signal was introduced in Esri.ArcGISRuntime 100.4.


extentChanged()

Emitted when the extent property changes.

Note: This signal will only be emitted when the property initializes during the instantiation of the component.

This QML signal was introduced in Esri.ArcGISRuntime 100.4.


hasCurvesChanged()

Emitted when the hasCurves property changes.

Note: This signal will only be emitted when the property initializes during the instantiation of the component.

This QML signal was introduced in Esri.ArcGISRuntime 100.4.


hasMChanged()

Emitted when the hasM property changes.

Note: This signal will only be emitted when the property initializes during the instantiation of the component.

This QML signal was introduced in Esri.ArcGISRuntime 100.4.


hasZChanged()

Emitted when the hasZ property changes.

Note: This signal will only be emitted when the property initializes during the instantiation of the component.

This QML signal was introduced in Esri.ArcGISRuntime 100.4.


spatialReferenceChanged()

Emitted when the spatialReference property changes.

Note: This signal will only be emitted when the property initializes during the instantiation of the component.

This QML signal was introduced in Esri.ArcGISRuntime 100.4.


Method Documentation

bool equals(Geometry other)

Compares other for equivalence


bool equalsWithTolerance(Geometry other, double tolerance)

Compares other for equivalence within a tolerance.



Feedback on this topic?