Geometry QML Type

  • Esri.ArcGISRuntime
  • Geometry
  • Base type for types that represent geometric shapes. More...

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

    Object

    Inherited By:

    Envelope, Multipart, Multipoint, and Point

    Properties

    Signals

    Methods

    Detailed Description

    Geometry is the base class for two-dimensional (x,y) or three-dimensional (x,y,z) geometries. Objects that inherit from the Geometry class may also include a measure (m-value) for each vertex. The Geometry class provides functionality common to all types of geometry. Point, Multipoint, Polyline, Polygon, and Envelope all inherit from Geometry and represent different types of shapes.

    Geometry represents real-world objects by defining a shape at a specific geographic location. It is used throughout this API to represent the shapes of features and graphics, layer extents, viewpoints, and GPS locations. It is also used, for example, to define inputs and outputs for spatial analysis and geoprocessing operations and to measure distances and areas.

    All types of geometry:

    • Have a SpatialReference indicating the coordinate system used by its coordinates
    • Can be empty, indicating that they have no specific location or shape
    • May have z-values and/or m-values to define elevation and measures respectively
    • Can be converted to and from JSON to be persisted or to be exchanged directly with REST services

    Immutability

    Most geometries are created and not changed for their lifetime. Examples include features created to be stored in a geodatabase or read from a non-editable layer, and features returned from tasks such as a spatial query, geocode operation, network trace, or geoprocessing task. Immutable geometries (geometries that cannot be changed) offer some important benefits to your app. They are inherently thread-safe, help prevent inadvertent changes, and allow for certain performance optimizations.

    Instead of changing the properties of existing geometries, you can create and update geometries using the various subclasses of GeometryBuilder (for example, PolygonBuilder), which can represent the state of a geometry under construction while allowing modifications, thus enabling editing workflows.

    Additionally, GeometryEngine offers a range of topological and spatial transformations that read the content of existing geometries and create new geometries, for example, project, buffer, union, and so on. Relational tests such as intersects and overlaps are also available on GeometryEngine.

    Coordinate units

    The coordinates that define a geometry are only meaningful in the context of the geometry's SpatialReference. The vertices and spatial reference together allow your app to translate a real-world object from its location on the Earth to its location on your map or scene.

    In some cases, a geometry's spatial reference may not be set. For example, a Graphic that does not have a spatial reference is drawn using the same spatial reference as the MapView to which it was added. If the coordinates are in a different spatial reference, the graphics may not display in the correct location, or at all.

    When using GeometryBuilder to create a Polyline or Polygon from a collection of Point, you don't need to set the spatial reference of every point before you add it to the builder, as it is assigned the spatial reference of the builder itself. In most other cases, such as when using a geometry in geometry operations or when editing a feature table, spatialReference must be set.

    Spatial reference and projection

    Changing the coordinates of a geometry to have the same shape and location represented using a different SpatialReference is known as "projection" or sometimes as "reprojection". Because geometries are immutable, they do not have any member methods that project, transform, or otherwise modify their content.

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

    See also JsonSerializable, GeometryEngine, GeometryBuilder, and GeometryEditor.

    Property Documentation

    [read-only] dimension : Enums.GeometryDimension

    The number of dimensions for the geometry (read-only).

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

    Returns Enums.GeometryDimensionUnknown if an error occurs.


    [read-only] empty : bool

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


    [read-only] extent : Envelope

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


    [read-only] geometryType : Enums.GeometryType

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


    [read-only] hasCurves : bool

    Returns true if this geometry contains curve segments; false otherwise (read-only).

    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 - for example Mobile Map Packages (MMPK) or geometry JSON. When connecting to ArcGIS feature services that support true curves, this API retrieves densified versions of curve feature geometries by default

    If a polygon or polyline geometry contains curve segments, this property returns true. Prior to Esri::ArcGISRuntime 100.12, it was not possible to access curve segments, and only LineSegment instances would be returned when iterating through the segments in a Polygon or Polyline object, regardless of this property.

    From Esri::ArcGISRuntime 100.12, you can use curve segments when using a MultipartBuilder to create or edit polygon and polyline geometries, and also get curve segments when iterating through the segments of existing Multipart geometries when this property returns true.

    You can also choose to return true curves from feature services by using ArcGISRuntimeEnvironment::serviceCurveGeometryMode.

    See also GeometryBuilder::hasCurves, Part::hasCurves, Segment::isCurve, CubicBezierSegment, and EllipticArcSegment.


    [read-only] hasM : bool

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


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


    [read-only] unknownJson : jsobject

    Returns the unknown JSON from the source JSON.

    See also JsonSerializable.


    [read-only] unsupportedJson : jsobject

    Returns the unsupported data from the source JSON.

    See also JsonSerializable.


    Signal Documentation

    [since Esri.ArcGISRuntime 100.4] emptyChanged()

    Emitted when the empty property changes.

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

    Note: The corresponding handler is onEmptyChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.4.


    [since 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.

    Note: The corresponding handler is onExtentChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.4.


    [since 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.

    Note: The corresponding handler is onHasCurvesChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.4.


    [since 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.

    Note: The corresponding handler is onHasMChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.4.


    [since 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.

    Note: The corresponding handler is onHasZChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.4.


    [since 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.

    Note: The corresponding handler is onSpatialReferenceChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.4.


    Method Documentation

    bool equals(Geometry other)

    Returns true if this geometry is equivalent with other.


    bool equalsWithTolerance(Geometry other, double tolerance)

    Returns true if this geometry is equivalent with other with a tolerance.


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