ArcGIS Runtime SDK for iOS: AGSLocation Class Reference
ArcGIS Runtime SDK for iOS  100.12
AGSLocation Class Reference

Description

Represents a location update provided by a location datasource.

Instance of this class represent a location update that is provided by a location datasource.

Since
100
See also
AGSLocationDisplay
AGSLocationDataSource
Inheritance diagram for AGSLocation:
AGSObject AGSNMEALocation

Instance Methods

(instancetype) - initWithPosition:horizontalAccuracy:velocity:course:lastKnown:
 
(instancetype) - initWithPosition:timestamp:horizontalAccuracy:verticalAccuracy:velocity:course:lastKnown:
 
(instancetype) - initWithPosition:timestamp:horizontalAccuracy:verticalAccuracy:velocity:course:lastKnown:additionalSourceProperties:
 

Class Methods

(AGSLocation *) + locationWithCLLocation:
 
(instancetype) + locationWithPosition:horizontalAccuracy:velocity:course:lastKnown:
 
(instancetype) + locationWithPosition:timestamp:horizontalAccuracy:verticalAccuracy:velocity:course:lastKnown:
 
(instancetype) + locationWithPosition:timestamp:horizontalAccuracy:verticalAccuracy:velocity:course:lastKnown:additionalSourceProperties:
 

Properties

NSDictionary< AGSLocationSourcePropertyKey, id > * additionalSourceProperties
 
double course
 
double horizontalAccuracy
 
BOOL lastKnown
 
AGSPointposition
 
NSDate * timestamp
 
double velocity
 
double verticalAccuracy
 

Method Documentation

◆ initWithPosition:horizontalAccuracy:velocity:course:lastKnown:

- (instancetype) initWithPosition: (AGSPoint *)  position
horizontalAccuracy: (double)  horizontalAccuracy
velocity: (double)  velocity
course: (double)  course
lastKnown: (BOOL)  lastKnown 

Creates a location update with provided information.

Parameters
positionThe coordinates of the location.
horizontalAccuracyThe radius of uncertainty for the location, measured in meters.
velocityThe velocity at which the device is traveling in meters per second.
courseThe direction in which the device is traveling, measured in degrees starting at due north and continuing clockwise around the compass.
lastKnownIndicates whether this is an outdated device position retrieved and cached earlier and therefore not guaranteed to represent the current location. Setting this to YES will render with the AGSLocationDisplay::acquiringSymbol, typically a grayed out location symbol.
Since
100

◆ initWithPosition:timestamp:horizontalAccuracy:verticalAccuracy:velocity:course:lastKnown:

- (instancetype) initWithPosition: (AGSPoint *)  position
timestamp: (NSDate *)  timestamp
horizontalAccuracy: (double)  horizontalAccuracy
verticalAccuracy: (double)  verticalAccuracy
velocity: (double)  velocity
course: (double)  course
lastKnown: (BOOL)  lastKnown 

Creates a location update with the provided information.

Parameters
positionThe coordinates of the location.
timestampThe date and time the location was determined.
horizontalAccuracyThe radius of uncertainty for the location, measured in meters.
verticalAccuracyThe accuracy of the vertical component of the location, measured in meters.
velocityThe velocity at which the device is traveling in meters per second.
courseThe direction in which the device is traveling, measured in degrees starting at due north and continuing clockwise around the compass.
lastKnownIndicates whether this is an outdated device position retrieved and cached earlier and therefore not guaranteed to represent the current location. Setting this to YES will render with the AGSLocationDisplay::acquiringSymbol, typically a grayed out location symbol.
Since
100.2.1

◆ initWithPosition:timestamp:horizontalAccuracy:verticalAccuracy:velocity:course:lastKnown:additionalSourceProperties:

- (instancetype) initWithPosition: (AGSPoint *)  position
timestamp: (nullable NSDate *)  timestamp
horizontalAccuracy: (double)  horizontalAccuracy
verticalAccuracy: (double)  verticalAccuracy
velocity: (double)  velocity
course: (double)  course
lastKnown: (BOOL)  lastKnown
additionalSourceProperties: (NSDictionary< AGSLocationSourcePropertyKey, id > *)  additionalSourceProperties 

Creates a location object with timestamp and additional source properties.

An AGSLocation object can be created from a variety of sources and using different technologies. By supplying the AGSLocation::additionalSourceProperties property you can allow users to find out how the data was captured.

Information should be provided as an NSDictionary of key-value pairs, where the AGSLocationSourceProperty key describes the type of data held in the id value. You can use any string for the key - but the Runtime SDK recognizes a number of well known keys which should be used if available. See AGSLocationSourcePropertyKey.

  • "floor" - The floor number of the AGSLocation object when in a building. Use AGSLocationSourcePropertyKeyFloor. This key should be associated with an NSNumber.
  • "satelliteCount" - The number of satellites used to fix the AGSLocation. Use AGSLocationSourcePropertyKeySatelliteCount. This key should be associated with an NSNumber.
  • "positionSource" - This key can be used to indicate the position source: GNSS, BLE, WIFI, CELL, IP, where GNSS indicates global navigation satellite system. It is possible to have multiple position sources. In that case positionSource is a list with comma-separated values. Use AGSLocationSourcePropertyKeyPositionSource. This key should be associated with an NSString.

Keys are case-sensitive.

Parameters
positionA point geometry.
timestampA timestamp when location was received.
horizontalAccuracyThe horizontal accuracy in meters. Positive values or NaN are supported.
verticalAccuracyThe vertical accuracy in meters. Positive values or NaN are supported.
velocityThe location's velocity in meters per second.
courseThe location's course in degrees (clockwise), 0 being true north.
lastKnownIndicates whether this is an outdated device position retrieved and cached earlier and therefore not guaranteed to represent the current location. Setting this to YES will render with the AGSLocationDisplay::acquiringSymbol property, typically a grayed out location symbol.
additionalSourcePropertiesAn NSDictionary of key-value pairs providing additional meta-data and properties about the source of this AGSLocation object.
See also
AGSLocation::additionalSourceProperties
Since
100.10

◆ locationWithCLLocation:

+ (AGSLocation*) locationWithCLLocation: (CLLocation *)  cllocation

Creates a location update with the provided information.

Note
If the provided CLLocation object has a timestamp more than 30 seconds in the past, the returned AGSLocation object will have lastKnown set to YES, otherwise it will be considered current and lastKnown will be NO.
Parameters
cllocationA CLLocation object representing the location data generated by CLLocationManager.
Returns
A new location object.
Since
100

◆ locationWithPosition:horizontalAccuracy:velocity:course:lastKnown:

+ (instancetype) locationWithPosition: (AGSPoint *)  position
horizontalAccuracy: (double)  horizontalAccuracy
velocity: (double)  velocity
course: (double)  course
lastKnown: (BOOL)  lastKnown 

Creates a location update with the provided information.

Parameters
positionThe coordinates of the location.
horizontalAccuracyThe radius of uncertainty for the location, measured in meters.
velocityThe velocity at which the device is traveling in meters per second.
courseThe direction in which the device is traveling, measured in degrees starting at due north and continuing clockwise around the compass.
lastKnownIndicates whether the information is current or based on a last known update (for example, in the case of deferred location updates).
Returns
A new location object.
Since
100

◆ locationWithPosition:timestamp:horizontalAccuracy:verticalAccuracy:velocity:course:lastKnown:

+ (instancetype) locationWithPosition: (AGSPoint *)  position
timestamp: (NSDate *)  timestamp
horizontalAccuracy: (double)  horizontalAccuracy
verticalAccuracy: (double)  verticalAccuracy
velocity: (double)  velocity
course: (double)  course
lastKnown: (BOOL)  lastKnown 

Creates a location update with the provided information.

Parameters
positionThe coordinates of the location.
timestampThe date and time the location was determined.
horizontalAccuracyThe radius of uncertainty for the location, measured in meters.
verticalAccuracyThe accuracy of the vertical component of the location, measured in meters.
velocityThe velocity at which the device is traveling in meters per second
courseThe direction in which the device is traveling, measured in degrees starting at due north and continuing clockwise around the compass.
lastKnownIndicates whether this is an outdated device position retrieved and cached earlier and therefore not guaranteed to represent the current location. Setting this to YES will render with the AGSLocationDisplay::acquiringSymbol property, typically a grayed out location symbol.
Returns
A new location object.
Since
100.2.1

◆ locationWithPosition:timestamp:horizontalAccuracy:verticalAccuracy:velocity:course:lastKnown:additionalSourceProperties:

+ (instancetype) locationWithPosition: (AGSPoint *)  position
timestamp: (nullable NSDate *)  timestamp
horizontalAccuracy: (double)  horizontalAccuracy
verticalAccuracy: (double)  verticalAccuracy
velocity: (double)  velocity
course: (double)  course
lastKnown: (BOOL)  lastKnown
additionalSourceProperties: (NSDictionary< AGSLocationSourcePropertyKey, id > *)  additionalSourceProperties 

Creates a location object with timestamp and additional source properties.

An AGSLocation object can be created from a variety of sources and using different technologies. By supplying the AGSLocation::additionalSourceProperties property you can allow users to find out how the data was captured.

Information should be provided as an NSDictionary of key-value pairs, where the AGSLocationSourceProperty key describes the type of data held in the id value. You can use any string for the key - but the Runtime SDK recognizes a number of well known keys which should be used if available. See AGSLocationSourcePropertyKey.

  • "floor" - The floor number of the AGSLocation when in a building. Use AGSLocationSourcePropertyKeyFloor. This key should be associated with an NSNumber.
  • "satelliteCount" - The number of satellites used to fix the AGSLocation object. Use AGSLocationSourcePropertyKeySatelliteCount. This key should be associated with an NSNumber.
  • "positionSource" - This key can be used to indicate the position source: GNSS, BLE, WIFI, CELL, IP, where GNSS indicates global navigation satellite system. It is possible to have multiple position sources. In that case positionSource is a list with comma-separated values. Use AGSLocationSourcePropertyKeyPositionSource. This key should be associated with an NSString.

Keys are case-sensitive.

Parameters
positionA point geometry.
timestampA timestamp when location was received.
horizontalAccuracyThe horizontal accuracy in meters. Positive values or NaN are supported.
verticalAccuracyThe vertical accuracy in meters. Positive values or NaN are supported.
velocityThe location's velocity in meters per second.
courseThe location's course in degrees (clockwise), 0 being true north.
lastKnownIndicates whether this is an outdated device position retrieved and cached earlier and therefore not guaranteed to represent the current location. Setting this to YES will render with the AGSLocationDisplay::acquiringSymbol, typically a grayed out location symbol.
additionalSourcePropertiesAn NSDictionary of key-value pairs providing additional meta-data and properties about the source of this AGSLocation.
Returns
A new location object.
See also
AGSLocation::additionalSourceProperties
Since
100.10

Property Documentation

◆ additionalSourceProperties

- (NSDictionary<AGSLocationSourcePropertyKey, id>*) additionalSourceProperties
readnonatomiccopy

A set of key-value pairs providing additional meta-data and properties about the source of this AGSLocation object.

An AGSLocation object can be created manually or by a variety of AGSLocationDataSource types

  • for example from the default platform data source or external GPS. When user code receives a new AGSLocation object, it can be important to determine how the information was obtained.

In addition, mobile devices may provide different details about their in-built location services. For example, Android systems can provide data on the number of satellites used to find a position, whereas on iOS this information is not available. When a given property is not available to the data source the entry should be omitted from the the AGSLocation::additionalSourceProperties property.

The AGSLocation::additionalSourceProperties property provides a means for the creator of an AGSLocation object to record flexible information such as:

  • The confidence level associated with the location
  • The method used to obtain the location
  • The provenance of the location

Information should be provided as an NSDictionary of key-value pairs, where the NSString key describes the type of data held in the id value. You can use any string for the key - but the Runtime SDK recognizes a number of well known keys which should be used if available. See AGSLocationSourcePropertyKey.

  • "floor" - The floor number of the AGSLocation when in a building. Use AGSLocationSourcePropertyKeyFloor. This key should be associated with an NSNumber.
  • "satelliteCount" - The number of satellites used to fix the AGSLocation. Use AGSLocationSourcePropertyKeySatelliteCount. This key should be associated with an NSNumber.
  • "positionSource" - This key can be used to indicate the position source: GNSS, BLE, WIFI, CELL, IP, where GNSS indicates global navigation satellite system. It is possible to have multiple position sources. In that case positionSource is a list with comma-separated values. Use AGSLocationSourcePropertyKeyPositionSource. This key should be associated with an NSString.

Keys are case-sensitive.

Since
100.10

◆ course

- (double) course
readnonatomicassign

The direction in which the device is traveling, measured in degrees starting at due north and continuing clockwise around the compass. Thus, north is 0 degrees, east is 90 degrees, south is 180 degrees, and so on. Course values may not be available on all devices. A negative value indicates that the direction is invalid.

Since
100

◆ horizontalAccuracy

- (double) horizontalAccuracy
readnonatomicassign

The radius of uncertainty for the location, measured in meters. The location’s position property identifies the center of the circle, and this value indicates the radius of that circle. A negative value indicates that the location’s position is invalid.

Since
100

◆ lastKnown

- (BOOL) lastKnown
readnonatomicassign

Indicates whether this is an outdated device position retrieved and cached earlier and therefore not guaranteed to represent the current location.

Since
100

◆ position

- (AGSPoint*) position
readnonatomicstrong

The coordinates of the location.

Since
100

◆ timestamp

- (NSDate*) timestamp
readnonatomicstrong

The time the location was determined.

Since
100.2.1

◆ velocity

- (double) velocity
readnonatomicassign

The instantaneous speed of the device in meters per second.

Since
100

◆ verticalAccuracy

- (double) verticalAccuracy
readnonatomicassign

The accuracy of the location's vertical component, in meters.

Since
100.2.1