SpatialReference

The spatial reference specifies how geometry coordinates relate to real-world space. Instances of this class represent a specific coordinate system identified by a well-known ID (WKID) number or well-known text (WKT) string. There are two broad classes of coordinate systems:

  • Geographic coordinate systems use a 3-dimensional spherical surface to define locations on the earth.

  • Projected coordinate systems use a flat, 2-dimensional surface. See [https://developers.arcgis.com/documentation/spatial-references/] for more information about spatial references.

SpatialReference ensures that you can accurately view, query, and analyze the layers of a GeoModel.

The spatial reference value is available from a map or scene after loading has completed, and is immutable. If you want to set this value for a new map or scene, use the ArcGISMap.ArcGISMap(SpatialReference) or ArcGISScene.ArcGISScene(SceneViewTilingScheme) constructors.

Since

200.1.0

Constructors

Link copied to clipboard
constructor(wkid: Int)

Creates a spatial reference based on WKID. The method will create a spatial reference that has only horizontal coordinate system and does not have vertical coordinate system associated with it.

constructor(wkid: Int, verticalWkid: Int)

Creates a spatial reference based on WKID for the horizontal coordinate system and vertical coordinate system. The method creates a spatial reference that has both horizontal and vertical coordinate systems. When the vertical WKID is 0, the method is equivalent to calling SpatialReference.SpatialReference(Int), and does not define a vertical coordinate system part.

constructor(wkText: String)

Creates a spatial reference based on well-known text.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

If the given spatial reference is a projected coordinate system, then this returns the geographic coordinate system of that system. If the spatial reference is a projected coordinate system, then a spatial reference object representing the underlying geographic coordinate system is returned. Every projected coordinate system has an underlying geographic coordinate system. If the spatial reference is a geographic coordinate system, then a reference to itself is returned. If the spatial reference is a local spatial reference, a null is returned with an error.

Link copied to clipboard

True if spatial reference has a vertical coordinate system set; false otherwise. 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).

Link copied to clipboard

True if spatial reference is a Geographic Coordinate System.

Link copied to clipboard

True if coordinate system is horizontally pannable.

Link copied to clipboard

True if spatial reference is a Projected Coordinate System.

Link copied to clipboard

The unit of measure for the horizontal coordinate system of this spatial reference.

Link copied to clipboard

The unit of measure for the vertical coordinate system of this spatial reference. Is null if SpatialReference.hasVertical is false.

Link copied to clipboard

The well-known ID for the vertical coordinate system (VCS), or 0 if the spatial reference has no VCS or has a custom VCS.

Link copied to clipboard
val wkid: Int

The well-known ID for the horizontal coordinate system, or 0 if the spatial reference has a custom horizontal coordinate system.

Link copied to clipboard

The well-known text for the horizontal and vertical coordinate system.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Calculate the grid convergence 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.

Link copied to clipboard
open override fun hashCode(): Int

Inherited functions

Link copied to clipboard
open override fun toJson(): String

Convert an object to JSON string.