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 or ArcGISScene.ArcGISScene 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, 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 minimum distance that separates unique x,y coordinate values when stored in an ArcGISFeatureTable. The resolution represents the detail in which a feature class records the location and shape of features, defining the number of decimal places stored. It is the minimum distance that separates x,y coordinate values in the Geometry of an ArcGISFeature. Any coordinates that differ by less than the resolution will be stored as the same coordinate value. The units of SpatialReference.resolution are the units of the horizontal coordinate system (SpatialReference.unit) defined when this spatial reference was created.

Link copied to clipboard

The minimum distance that determines if two x,y coordinates are considered to be at the same location for relational and topological GeometryEngine operations. This value is used in relational and topological GeometryEngine operations when determining whether two points are close enough, in the horizontal plane, to be considered as the same coordinate value when calculating the result. The units of SpatialReference.tolerance are the units of the horizontal coordinate system (SpatialReference.unit) defined when this spatial reference was created.

Link copied to clipboard

The unit of measure for the horizontal coordinate system of this spatial reference. Also the unit of measure for SpatialReference.tolerance and SpatialReference.resolution.

Link copied to clipboard

The minimum distance that separates unique z-values when stored in an ArcGISFeatureTable. The vertical resolution represents the detail in which a feature class records the location and shape of features, defining the number of decimal places or significant digits stored. It is the minimum distance that separates z-values in the Geometry of an ArcGISFeature. Any z-values that differ by less than the vertical resolution will be stored as the same z-value. The units of SpatialReference.verticalResolution are the units of the vertical coordinate system (SpatialReference.verticalUnit) defined when this spatial reference was created, if one was set.

Link copied to clipboard

The minimum distance that determines if two z-values are considered to be at the same location for GeometryEngine operations that compare z-values. This value is used in relational and topological GeometryEngine operations when determining whether two z-values are close enough to be considered as the same value when calculating the result. The units of SpatialReference.verticalTolerance are the units of the vertical coordinate system (SpatialReference.verticalUnit) defined when this spatial reference was created, if one was set.

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 systems. If this coordinate system can only be represented in WKT2 format this property returns an empty string.

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.