Click or drag to resize
SpatialReference Class
Instances of this class represent a spatial reference.
Inheritance Hierarchy
SystemObject
  Esri.ArcGISRuntime.GeometrySpatialReference

Namespace: Esri.ArcGISRuntime.Geometry
Assembly: Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 10.2.7.0 (10.2.7.1234)
Syntax
public class SpatialReference

The SpatialReference type exposes the following members.

Constructors
  NameDescription
Public methodSpatialReference(Int32)
Initializes a new instance of the SpatialReference class.
Public methodSpatialReference(String)
Initializes a new instance of the SpatialReference class.
Public methodSpatialReference(Int32, Int32)
Initializes a new instance of the SpatialReference class.
Top
Methods
  NameDescription
Public methodStatic memberCreate(Int32)
Returns an instance of the SpatialReference class.
Public methodStatic memberCreate(String)
Initializes a new instance of the SpatialReference class.
Public methodStatic memberCreate(Int32, Int32)
Initializes a new instance of the SpatialReference class.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodStatic memberFromJson
Creates an instance of a spatial reference from a JSON string.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsEqual
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.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToJson
Creates an ArcGIS JSON representation of the spatial reference/>
Public methodToString
Returns a String that represents the current Object.
(Overrides ObjectToString.)
Top
Properties
  NameDescription
Public propertyBaseGeographic
Gets the base geographic coordinate system if this is a projected coordinate system.
Public propertyIsGeographic
Returns true if this is a geographic coordinate system.
Public propertyIsPannable
Returns true if this coordinate system supports wrap around.
Public propertyIsProjected
Returns true if this is a projected coordinate system.
Public propertyUnit
The units that the spatial reference coordinates are in.
Public propertyVerticalWkid
Gets the vertical coordinate system Well-known ID.
Public propertyWkid
Gets the Well-known ID for this instance.
Public propertyWkText
Gets the Well-known Text for this instance.
Top
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.

See Also
Supported Platforms
This type is supported on the following ArcGIS Runtime .NET SDK platforms:
Windows Desktop
Windows Phone
Windows Store
Additional Examples
Hyperlink to ExampleDescription
ArcGISDynamicMapServiceLayerImageFormatShows changing the return ImageFormat for ArcGISDynamicMapServiceLayer and how that appears visually in the Map.
ArcGISDynamicMapServiceLayerXamlAndCodeBehindShows creating an ArcGISDynamicMapServiceLayer in XAML and via code-behind. The ArcGISDynamicMapServiceLayer.InitializeAsync Method is used to obtain metadata about the layer (i.e. ID and Copyright) using the Async/Task framework.
ArcGISImageServiceLayerWindowShows creating an ArcGIS Image Service Layer and applying rendering rules.
ArcGISImageServiceLayerXamlAndCodeBehindShows adding an ArcGISImageServiceLayer via XAML and code-behind. The ArcGISImageServiceLayer.InitializeAsync Method is used to obtain metadata about the layer (i.e. ID and Description) using the Async/Task framework.
Camera_PropertiesShows adjusting the Camera Properties of a SceneView to view different perspectives of data on the Earth.
Camera_SetMethodsDemonstrates navigating/animating between MapPoint Graphics with a Camera. Simultaneous changes of X, Y, Z, Pitch, and Heading during the animation is shown.
EqualGeometriesDemonstrates the differences in comparing a few polygon geometries to via the Geometry.IsEqual and GeometryEngine.Equals Methods.
FeatureLayer_LabelingDemonstrates labeling highway names in a FeatureLayer.
FeatureLayer_SelectFeaturesByRectangleDemonstrates selecting features in a FeatureLayer by dragging a rectangle across the map. Features are then highlighted in the FeatureLayer and their selected ID values are displayed in a Listbox.
FeatureLayerViaGeodatabaseDemonstrates creating a FeatureLayer from a GeodatabaseFeatureTable in an ArcGIS Runtime provisioned Geodatabase that is stored locally on disk.
FeatureLayerViaGeodatabaseWebDownloadDemonstrates downloading a Geodatabase on ArcGIS Server to the local disk and then creating a FeatureLayer from a GeodatabaseFeatureTable in the downloaded Geodatabase.
FeatureLayerViaShapefileDemonstrates creating a FeatureLayer from a ShapefileTable that is stored locally on disk.
FeatureLayerXamlAndCodeBehindShows creating a FeatureLayer in XAML and via code-behind. The FeatureLayer.InitializeAsync Method is used to obtain metadata about the layer (i.e. ID and Copyright) using the Async/Task framework.
FindTaskDemonstrates using the Query.FindTask operation to search for text in attribute fields of an ArcGIS Server map service and display the features found as graphics in a GraphicsLayer.
GeocodeFullAddressInputDemonstrates performing a geocode by submitting values for multiple address fields.
GeocodeSingleLineInputPerforms a single line geocode using either an online ArcGIS Locator service or a local Locator.
GeometryEngine_Difference_Intersection_UnionDemonstrates using the powerful GeometryEngine local process to perform the spatial analysis operations of Difference, Intersection, and Union on two input geometries.
GeometryEngine_TestingSpatialRelationshipsDemonstrates using the powerful GeometryEngine local process to test various spatial relationships (Contains, Crosses, Disjoint, Equals, Intersects, Overlaps, Touches, Within) between two input geometries.
GetAreaAllows the user to draw a polygon on the map and calculate the area via several methods.
GraphicsLayer_LabelingDemonstrates labeling city names where two AttributeLabelClass'es are used (one for smaller cities and one for larger ones).
GraphicsOverlayDemonstrates using the Query.FindTask operation to return county features in an ArcGIS Server map service and display the features found as Graphics in a GraphicsOverlay. The user can perform a MapViewTapped on the Graphics to perform a GraphicsOverlay.HitTestAsync to select features and display attribute information.
IdentifyParameter_DynamicLayerInfosDemonstrates performing an Identify on a Dynamic Layer using the ESRI.ArcGISRuntime.Tasks.Query.IdentifyParameter.DynamicLayerInfos Property.
IdentifyTaskDemonstrates using the Query.IdentifyTask operation find a feature based upon it's geographic position in an ArcGIS Server map service and display it as a graphic in a GraphicsLayer.
InitialMapExtentCodeShows how to set the initial extent of the map (Map.InitialExtent) in code.
LayerDefinitionsDemonstrates setting numerous LayerDefinitions values on an ArcGISDynamicMapServiceLayer and visualizing the impact of the features being returned in the Map.
MapServiceInfo_DocumentInfo_LayerServiceInfoDemonstrates getting detailed ArcGIS Server MapServer metadata to obtain MapServiceInfo data for various ArcGISDynamicMapServiceLayer and ArcGISTiledMapServiceLayer web services.
MapView_SpatialReferenceDemonstrates reseting the MapView.SpatialReference by setting it to a new Map.
PolygonBuilder_MakeIslandsShows how to use the PolygonBuilder to turn multiple independent Polygons into a single Polygon (use case: grouping island Polygons together into one record).
PolygonFromScratchDemonstrates creating a simple polygon, donut polygon, and multiple ring polygon via code-behind. An option to view coordinate information for each vertex in the polygons is provided.
QueryTableDataSourceDemonstrates adding a Dynamic Layer via code-behind using a QueryTableDataSource.
RoutingPointToPointDemonstrates simple point to point routing between two input locations.
RoutingWithBarriersShows routing and re-routing around user defined point, polyline, and polygon barriers.
RoutingWithDirectionsInteraction logic for RoutingWithDirections.xaml