Skip To Content ArcGIS for Developers Sign In Dashboard

SpatialReference QML Type

A spatial reference that defines how coordinates correspond to locations in the real world. More...

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

Object

Properties

Signals

Methods

Detailed Description

Instances of this type represent a specific coordinate system, identified by a well-known ID (WKID) number or well-known text (WKT) string. SpatialReferences are immutable.

SpatialReferences allow disparate spatial data to be consistently viewed and analyzed together. Geometry, Layer, and GraphicsOverlay types have a SpatialReference that determines the system in which the data is stored, and the SpatialReference of each GeoView determines how it displays the data it contains. There are two main categories of coordinate system that can be represented by a SpatialReference:

  • Geographic coordinate systems use a three-dimensional spherical surface to define locations on the earth. Coordinates are defined using angular units such as degrees.
  • Projected coordinate systems use flat, two-dimensional surface to define locations on the earth. Coordinates are defined using linear units such as meters or miles.

In some cases, more than one WKID value refer to the same spatial reference. For example, 3857 and 102100 both refer to WGS 1984 Web Mercator (Auxiliary Sphere). There can also be subtle differences between two WKT strings that that represent the same spatial reference. To mitigate this situation, the SpatialReference type provides spatial reference comparison methods.

Use the create method to create a SpatialReference by specifying the WKID of a coordinate system, or use the members of SpatialReferences to return instances of the most commonly used SpatialReferences.

See Projected Coordinate Systems and Geographic Coordinate Systems for the list of supported spatial references and their corresponding definition strings.

See also JsonSerializable.

Property Documentation

baseGeographic : SpatialReference

Returns the base geographic coordinate system of the spatial reference (read-only).


isGeographic : bool

Returns whether this is a geographic coordinate system (read-only).


isPannable : bool

Returns whether the coordinate system is continuously horizontally pannable (read-only).

Continuously pannable coordinate systems include geographic coordinate systems and some cylindrical projected coordinate systems.


isProjected : bool

Returns whether this is a projected coordinate system (read-only).


unit : Unit

Returns the unit from a spatial reference (read-only).


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.


verticalWkid : int

The well-known numeric spatial reference identifier (WKID) for the vertical coordinate system.

In conjunction with the verticalWkid property, you must also provide the wkid property for the vertical WKID to be applied.


wkText : string

The wkt (well-known text spatial reference identifier) for this spatial reference.


wkid : int

The well-known numeric spatial reference identifier for this spatial reference.


Signal Documentation

baseGeographicChanged()

Emitted when the baseGeographic 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.


isGeographicChanged()

Emitted when the isGeographic 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.


isPannableChanged()

Emitted when the isPannable 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.


isProjectedChanged()

Emitted when the isProjected 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.


unitChanged()

Emitted when the unit 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.


verticalWkidChanged()

Emitted when the verticalWkid 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.


wkTextChanged()

Emitted when the wkText 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.


wkidChanged()

Emitted when the wkid 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

double convergenceAngle(Point point)

Returns the grid convergence in degrees for a spatial reference at a given point.

The grid convergence is the angle between True North and Grid North at a point on a map. The grid convergence can be used to convert a horizontal direction expressed as an azimuth in a geographic coordinate system (relative to True North) to a direction expressed as a bearing in a projected coordinate system (relative to Grid North), and vice versa.

Sign convention

The grid convergence returned by this method is positive when Grid North lies east of True North. The following formula demonstrates how to obtain a bearing (b) from an azimuth (a) using the grid convergence (c) returned by this method:

b = a - c

This sign convention is sometimes named the Gauss-Bomford convention.

Other notes

  • Returns 0 if the spatial reference is a geographic coordinate system.
  • Returns NAN if the point is outside the projection's horizon or on error.
  • If the point has no spatial reference, it is assumed to be in the given spatial reference.
  • If the point's spatial reference differs from the spatial reference given, it's location will be transformed automatically to the given spatial reference.

This QML method was introduced in Esri.ArcGISRuntime 100.3.


SpatialReference createWebMercator()

A static method that returns a spatial reference initialized to Web Mercator.


SpatialReference createWgs84()

A static method that returns a spatial reference initialized to WGS84.


bool equals(SpatialReference other)

compares this spatial reference against the other.

Returns true if they are equal.



Feedback on this topic?