ArcGIS Runtime SDK for iOS
100.13

Represents the spatial reference of a geometry.
A spatial reference determines how map coordinates, or the x,y,zcoordinates in the vertices of geometries, correspond to locations in realworld space. Therefore, it is very important to associate geometries representing spatial data with corresponding spatial references.
Each spatial reference can be represented by either a wellknown ID (WKID), or a wellknown 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 3dimensional spherical surface to define locations on the earth. A Projected Coordinate system on the other hand uses a flat, 2dimensional surface.
Learn more about coordinate systems
AGSGeometry
for geometry types + projectGeometry:toSpatialReference: (AGSGeometryEngine)
to project geometries from one spatial reference to another Instance Methods  
(double)   convergenceAngleWithPoint: 
(nullable instancetype)   initWithWKID: 
(nullable instancetype)   initWithWKID:verticalWKID: 
(nullable instancetype)   initWithWKText: 
(BOOL)   isEqualToSpatialReference: 
(nullable id)   toJSON: 
Class Methods  
(nullable id< AGSJSONSerializable >)  + fromJSON:error: 
(nullable instancetype)  + spatialReferenceWithWKID: 
(nullable instancetype)  + spatialReferenceWithWKID:verticalWKID: 
(nullable instancetype)  + spatialReferenceWithWKText: 
(AGSSpatialReference *)  + webMercator 
(AGSSpatialReference *)  + WGS84 
Properties  
AGSSpatialReference *  baseGeographic 
BOOL  geographic 
BOOL  hasVertical 
BOOL  pannable 
BOOL  projected 
AGSUnit *  unit 
NSDictionary< NSString *, id > *  unknownJSON 
NSDictionary< NSString *, id > *  unsupportedJSON 
NSInteger  verticalWKID 
NSInteger  WKID 
NSString *  WKText 
 (double) convergenceAngleWithPoint:  (AGSPoint *)  point 
Calculate the grid convergence for a spatial reference at a given point.
Remarks
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.
Sign convention
The grid convergence returned by this method is positive when Grid North lies east of True North. The following formula demonstrates how to obtain a bearing (b) from an azimuth (a) using the grid convergence (c) returned by this method: b = a  c.
This sign convention is sometimes named the GaussBomford convention.
Other Notes
0
if the spatial reference is a geographic coordinate system NAN
if the point is outside the projection's horizon or on error point  The point at which to calculate the convergence angle. 

staticrequiredinherited 
Initializes and returns an object from its JSON representation.
JSONObject  NSDictionary or NSArray containing the JSON. 
error  encountered during the operation, if any. 
 (nullable instancetype) initWithWKID:  (NSInteger)  WKID 
Creates a spatial reference with the given wellknown ID (WKID).
WKID  The wellknown ID. 
 (nullable instancetype) initWithWKID:  (NSInteger)  WKID  
verticalWKID:  (NSInteger)  verticalWKID  
Creates a spatial reference with the given wellknown ID (WKID) and a vertical wellknown ID.
 (nullable instancetype) initWithWKText:  (NSString *)  WKText 
Creates a spatial reference with the given wellknown text (WKT).
WKText  The wellknown text. 
 (BOOL) isEqualToSpatialReference:  (AGSSpatialReference *)  other 
Compares whether two spatial references are equal. They are equal if they have the same WKID
or #WKT
.
other  The other spatial reference to compare this one to. 
YES
if the spatial references are equal. + (nullable instancetype) spatialReferenceWithWKID:  (NSInteger)  WKID 
Creates a spatial reference with the given wellknown ID (WKID).
WKID  The wellknown ID 
+ (nullable instancetype) spatialReferenceWithWKID:  (NSInteger)  WKID  
verticalWKID:  (NSInteger)  verticalWKID  
Creates a spatial reference with the given wellknown ID (WKID) and a vertical wellknown ID.
WKID  The well known ID of the horizontal coordinate system. Must be a positive value. 
verticalWKID  The well known ID of the vertical coordinate system. Must be a non negative value. 
+ (nullable instancetype) spatialReferenceWithWKText:  (NSString *)  WKText 
Creates a spatial reference with the given wellknown text (WKT).
WKText  The wellknown text 

requiredinherited 
Returns JSON representation for this object.
error  encountered during the operation, if any. 
NSDictionary
or NSArray
containing the JSON. Reimplemented in AGSPortalItem.
+ (AGSSpatialReference*) webMercator 
A spatial reference representing the Web Mercator coordinate system (WKID:3857, equivalent to WKID:102113).
+ (AGSSpatialReference*) WGS84 
A spatial reference representing the WGS84 coordinate system (WKID:4326).

readnonatomicstrong 
If the given spatial reference is a projected coordinate system, then this will return 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 nil
is returned.

readnonatomicassign 
YES
if spatial reference is a Geographic Coordinate System.

readnonatomicassign 
YES
if spatial reference has a vertical coordinate system set; NO
otherwise.
A spatial reference can optionally include a definition for a vertical coordinate system (VCS), which can be used to interpret the zvalues of a geometry. A VCS defines linear units of measure, the origin of zvalues, and whether zvalues are "positive up" (representing heights above a surface) or "positive down" (indicating that values are depths below a surface).
An AGSSpatialReference
may have a VCS set, for example by calling the initWithWKID:verticalWKID:
constructor. AGSSpatialReference::verticalWKID
and AGSSpatialReference::WKText
provide more information about the specific VCS set on this instance.
VCSs are used when projecting geometries using an AGSHorizontalVerticalTransformation
.

readnonatomicassign 
YES
if coordinate system is horizontally pannable.

readnonatomicassign 
YES
if spatial reference is a Projected Coordinate System.

readnonatomicstrong 
The units of geometry's coordinates for geometries that use this spatial reference.

readrequirednonatomiccopyinherited 
A dictionary of values that was in the source JSON but was unparsed by API.
NSDictionary
containing the unknown JSON.

readnonatomiccopyinherited 
A dictionary of values that are supported by the REST API, but not exposed through the SDK API.
NSDictionary
containing the unsupported JSON.

readnonatomicassign 
The wellknown ID for the vertical coordinate system.
The wellknown ID for the vertical coordinate system (VCS) set on this AGSSpatialReference
.
Returns 0
if there is no VCS set, if there is a custom VCS set.
 initWithWKID:verticalWKID:

readnonatomicassign 
The wellknown ID for the horizontal coordinate system.
The wellknown ID for the horizontal coordinate system. Will return 0
if an error occurs.

readnonatomiccopy 
The wellknown text of the spatial reference.