Show / Hide Table of Contents

Class SpatialReference

Instances of this class represent a spatial reference.

Inheritance
Object
SpatialReference
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
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 based on the given well-known ID.

Create(Int32, Int32)

Returns an instance of the SpatialReference class based on well-known IDs for the horizontal and vertical coordinate systems.

Create(String)

Returns an instance of the SpatialReference class based on well-known text (WKT).

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 String that represents the current Object.

Applies to

TargetVersions
.NET Standard 2.0100.3 - 200.0
.NET 6.0100.13 - 200.0
.NET 6.0 Windows100.13 - 200.0
.NET 6.0 Android200
.NET 6.0 iOS200
.NET Framework100.0 - 200.0
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Android100.0 - 100.15
iOS100.0 - 100.15
UWP100.0 - 200.0

Relevant samples

Add features: Add features to a feature layer.
Add graphics with symbols: Use a symbol style to display a graphic on a graphics overlay.
Analyze hotspots: Use a geoprocessing service and a set of features to identify statistically significant hot spots and cold spots.
In This Article
Back to top Copyright © 2022 Esri.