Show / Hide Table of Contents

Class SpatialReference

Instances of this class specifies how geometry coordinates relate to real-world space.

Inheritance
System.Object
SpatialReference
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Esri.ArcGISRuntime.Geometry
Assembly: Esri.ArcGISRuntime.dll
Syntax
public class SpatialReference
Remarks

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 spatial references) for more information.

Spatial reference ensures that you can accurately view, query, and analyze the layers of a geo model.

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 map's spatial reference or the scene's SceneViewTiling scheme constructors.

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

Applies to

TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.0 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.0 - 200.7
Xamarin.Android100.0 - 100.15
Xamarin.iOS100.0 - 100.15
UWP100.0 - 200.7

Relevant samples

Create, delete, and update features: Add, delete, and update features (geometry and attributes) in 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.