Class SpatialReference
Instances of this class represent a spatial reference.
Namespace: Esri.ArcGISRuntime.Geometry
Assembly: Esri.ArcGISRuntime.dll
Syntax
public class SpatialReference
Remarks
Each spatial reference can be represented by either a well-known ID (wkid), or a well-known text (wkt). Spatial References define the spatial properties of a geometry, for instance the coordinate system it uses. There are 2 broad classes of coordinate systems - Geographic & Projected. A Geographic Coordinate system uses a 3-dimensional spherical surface to define locations on the earth. A Projected Coordinate system on the other hand uses a flat, 2-dimensional surface. More information about spatial references and coordinate systems is available here.
It is very important to associate spatial data, such as geometry objects, with corresponding spatial references.
Properties
| Name | Description |
|---|---|
| BaseGeographic | Gets the base geographic coordinate system if this is a projected coordinate system. |
| HasVertical | Gets a value indicating whether spatial reference has a vertical coordinate system set. |
| IsGeographic | Gets a value indicating whether this is a geographic coordinate system. |
| IsPannable | Gets a value indicating whether the coordinate system is horizontally pannable. |
| IsProjected | Gets a value indicating whether the spatial reference is a Projected Coordinate System. |
| Unit | Gets the unit of measure for this spatial reference system. |
| VerticalUnit | Gets the unit of measure for the vertical coordinate system of this spatial reference. |
| VerticalWkid | Gets the well-known ID for the vertical coordinate system (VCS), or 0 if the spatial reference has no VCS or has a custom VCS. |
| Wkid | Gets the well-known ID for the horizontal coordinate system, or 0 if the spatial reference has a custom horizontal coordinate system. |
| WkText | Gets the well-known text for the horizontal and vertical coordinate system. |
Methods
| Name | Description |
|---|---|
| Create(Int32) | Returns an instance of the SpatialReference class. |
| Create(Int32, Int32) | Initializes a new instance of the SpatialReference class. |
| Create(String) | Initializes a new instance of the SpatialReference class. |
| FromJson(String) | Creates an instance of a spatial reference from a JSON string. |
| GetConvergenceAngle(MapPoint) | Calculates the grid convergence for a spatial reference at a given point. |
| IsEqual(SpatialReference) | Returns true of the Spatial references are the same, this includes where older Wkid refer to the same underlying spatial reference as a newer id. |
| IsValidVerticalWkid(Int32) | Returns a value indicating whether the specified well-known ID can be used to create a vertical coordinate system. |
| IsValidWkid(Int32) | Returns a value indicating whether the specified well-known ID can be used to create a horizontal coordinate system. |
| IsValidWkt(String) | Returns a value indicating whether the specified string is a valid well-known text. |
| ToJson() | Creates an ArcGIS JSON representation of the spatial reference. |
| ToString() | Returns a System.String that represents the current Object. |
Applies to
| Target | Versions |
|---|---|
| .NET Standard 2.0 | 100.3 - 100.15 |
| .NET 6.0 | 100.13 - 100.15 |
| .NET 6.0 Windows | 100.13 - 100.15 |
| .NET Framework | 100.0 - 100.15 |
| .NET 5 | 100.10 - 100.12 |
| .NET Core 3.1 | 100.7 - 100.12 |
| Xamarin.Android | 100.0 - 100.15 |
| Xamarin.iOS | 100.0 - 100.15 |
| UWP | 100.0 - 100.15 |