A spatial reference that defines how coordinates correspond to locations in the real world. More...
Import Statement: | import Esri.ArcGISRuntime 100.15 |
Since: | Esri.ArcGISRuntime 100.0 |
Inherits: |
Properties
- baseGeographic : SpatialReference
- hasVertical : bool
- isGeographic : bool
- isPannable : bool
- isProjected : bool
- unit : Unit
- unknownJson : jsobject
- unsupportedJson : jsobject
- verticalUnit : LinearUnit
- verticalWkid : int
- wkText : string
- wkid : int
Signals
- baseGeographicChanged()
- hasVerticalChanged()
- isGeographicChanged()
- isPannableChanged()
- isProjectedChanged()
- unitChanged()
- verticalWkidChanged()
- wkTextChanged()
- wkidChanged()
Methods
- double convergenceAngle(Point point)
- SpatialReference createWebMercator()
- SpatialReference createWgs84()
- bool equals(SpatialReference other)
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).
true
if spatial reference has a vertical coordinate system set; false
otherwise (read-only).
A spatial reference can optionally include a definition for a vertical coordinate system (VCS), which can be used to interpret the z-values of a geometry. A VCS defines linear units of measure, the origin of z-values, and whether z-values are "positive up" (representing heights above a surface) or "positive down" (indicating that values are depths below a surface).
A SpatialReference may have a VCS set by calling the SpatialReference::verticalWkid constructor. SpatialReference::verticalWkid, SpatialReference::wkText, and SpatialReference::verticalUnit provide more information about the specific VCS set on this instance.
VCSs are used when projecting geometries using a HorizontalVerticalTransformation.
This property was introduced in Esri.ArcGISRuntime 100.9.
See also verticalWkid and verticalUnit.
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.
unit : Unit |
Returns the unit of measure for the horizontal coordinate system of this spatial reference.
Returns the unknown JSON from the source JSON.
See also JsonSerializable.
Returns the unsupported data from the source JSON.
See also JsonSerializable.
verticalUnit : LinearUnit |
The unit of measure for the vertical coordinate system of this spatial reference (read-only). Is null
if hasVertical is false
.
This property was introduced in Esri.ArcGISRuntime 100.14.
The well-known ID for the vertical coordinate system (VCS), or 0 if the spatial reference has no VCS or has a custom VCS.
In conjunction with the verticalWkid property, you must also provide the wkid property for the vertical WKID to be applied.
The well-known ID for the horizontal coordinate system, or 0
if the spatial reference has no WKID or a custom horizontal coordinate system.
Signal Documentation
Emitted when the baseGeographic property changes.
Note: This signal will only be emitted when the property initializes during the instantiation of the component.
Note: The corresponding handler is onBaseGeographicChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.4.
Emitted when the hasVertical property changes.
Note: This signal will only be emitted when the property initializes during the instantiation of the component.
Note: The corresponding handler is onHasVerticalChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.9.
Emitted when the isGeographic property changes.
Note: This signal will only be emitted when the property initializes during the instantiation of the component.
Note: The corresponding handler is onIsGeographicChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.4.
Emitted when the isPannable property changes.
Note: This signal will only be emitted when the property initializes during the instantiation of the component.
Note: The corresponding handler is onIsPannableChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.4.
Emitted when the isProjected property changes.
Note: This signal will only be emitted when the property initializes during the instantiation of the component.
Note: The corresponding handler is onIsProjectedChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.4.
Emitted when the unit property changes.
Note: This signal will only be emitted when the property initializes during the instantiation of the component.
Note: The corresponding handler is onUnitChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.4.
Emitted when the verticalWkid property changes.
Note: This signal will only be emitted when the property initializes during the instantiation of the component.
Note: The corresponding handler is onVerticalWkidChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.4.
Emitted when the wkText property changes.
Note: This signal will only be emitted when the property initializes during the instantiation of the component.
Note: The corresponding handler is onWkTextChanged
.
This signal was introduced in Esri.ArcGISRuntime 100.4.
Emitted when the wkid property changes.
Note: This signal will only be emitted when the property initializes during the instantiation of the component.
Note: The corresponding handler is onWkidChanged
.
This 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, its location is transformed automatically to the given spatial reference.
This method was introduced in Esri.ArcGISRuntime 100.3.
SpatialReference createWebMercator() |
A static method that returns a spatial reference initialized to Web Mercator.
This method can only be accessed via the Factory object now since the 100.9 release.
//SpatialReference.createWebMercator(); // old code Factory.SpatialReference.createWebMercator(); // replacement code
SpatialReference createWgs84() |
A static method that returns a spatial reference initialized to WGS84.
This method can only be accessed via the Factory object now since the 100.9 release.
//SpatialReference.createWgs84(); // old code Factory.SpatialReference.createWgs84(); // replacement code
bool equals(SpatialReference other) |
compares this spatial reference against the other.
Returns true
if they are equal.