SITLocation
Objective-C
@interface SITLocation : NSObject <NSCopying, SITMapperProtocol>
Swift
class SITLocation : NSObject, NSCopying, SITMapperProtocol
Describes a geographical position of the user, either indoor or outdoor. A valid indoor location has floorIdentifier and cartesianCoordinate in its position property.
-
Constructor.
Declaration
Objective-C
- (instancetype _Nonnull)initWithTimestamp:(NSTimeInterval)timestamp position:(SITPoint *_Nonnull)position bearing:(float)bearing cartesianBearing:(float)cartesianBearing quality:(kSITQualityValues)quality accuracy:(float)accuracy provider:(NSString *_Nonnull)provider;
Swift
init(timestamp: TimeInterval, position: SITPoint, bearing: Float, cartesianBearing: Float, quality: kSITQualityValues, accuracy: Float, provider: String)
Parameters
timestamp
since 1970 when the location was determined, in milliseconds
position
geographical coordinate information.
bearing
the direction in which the device is traveling in geographical coordinate system (degrees)
cartesianBearing
The direction in which the device is traveling in cartesian coordinate system (radians)
quality
indicative of quality calculated with accuracy and building size.
accuracy
ccuracy radius (in meters).
provider
multiple providers can create locations. Determines which one has determined the location.
Return Value
initialized location
-
Constructor.
Declaration
Objective-C
- (instancetype _Nonnull)initWithTimestamp:(NSTimeInterval)timestamp position:(SITPoint *_Nonnull)position bearing:(float)bearing cartesianBearing:(float)cartesianBearing quality:(kSITQualityValues)quality bearingQuality:(kSITQualityValues)bearingQuality accuracy:(float)accuracy provider:(NSString *_Nonnull)provider;
Swift
init(timestamp: TimeInterval, position: SITPoint, bearing: Float, cartesianBearing: Float, quality: kSITQualityValues, bearingQuality: kSITQualityValues, accuracy: Float, provider: String)
Parameters
timestamp
since 1970 when the location was determined, in milliseconds
position
geographical coordinate information.
bearing
the direction in which the device is traveling in geographical coordinate system (degrees)
cartesianBearing
The direction in which the device is traveling in cartesian coordinate system (radians)
quality
indicative of quality calculated with accuracy and building size.
bearingQuality
indication of the quality of the bearing value
accuracy
ccuracy radius (in meters).
provider
multiple providers can create locations. Determines which one has determined the location.
Return Value
initialized location
-
-initWithTimestamp:
position: bearing: cartesianBearing: quality: bearingQuality: accuracy: provider: pitch: roll: Default initializer
Declaration
Objective-C
- (instancetype _Nonnull)initWithTimestamp:(NSTimeInterval)timestamp position:(SITPoint *_Nonnull)position bearing:(float)bearing cartesianBearing:(float)cartesianBearing quality:(kSITQualityValues)quality bearingQuality:(kSITQualityValues)bearingQuality accuracy:(float)accuracy provider:(NSString *_Nonnull)provider pitch:(float)pitch roll:(float)roll;
Swift
init(timestamp: TimeInterval, position: SITPoint, bearing: Float, cartesianBearing: Float, quality: kSITQualityValues, bearingQuality: kSITQualityValues, accuracy: Float, provider: String, pitch: Float, roll: Float)
Parameters
timestamp
since 1970 when the location was determined, in milliseconds
position
geographical coordinate information.
bearing
the direction in which the device is traveling in geographical coordinate system (degrees)
cartesianBearing
The direction in which the device is traveling in cartesian coordinate system (radians)
quality
indicative of quality calculated with accuracy and building size.
bearingQuality
indication of the quality of the bearing value
accuracy
ccuracy radius (in meters).
provider
multiple providers can create locations. Determines which one has determined the location.
pitch
angle that represents the orientation of the device against to pitch axis, being 0 perfectly horizontal
roll
angle that represents the orientation of the device against the roll axis, being 0 perfectly horizontal
Return Value
initialized location
-
The time interval since 1970 at which this location was determined, expressed in milliseconds
Declaration
Objective-C
@property (nonatomic) NSTimeInterval timestamp;
Swift
var timestamp: TimeInterval { get set }
-
Indication of the quality of the bearing value
Note
kSITHigh means the system is very confident on the bearing values. kSITLow means the system is still trying to determine the correct bearing; this situation happens when initializing the system.Declaration
Objective-C
@property (nonatomic) kSITQualityValues bearingQuality;
Swift
var bearingQuality: kSITQualityValues { get set }
-
Return an indicative of quality calculated with accuracy and building size.
Note
Only used in indoor.Declaration
Objective-C
@property (nonatomic) kSITQualityValues quality;
Swift
var quality: kSITQualityValues { get set }
-
Return the accuracy radius (in meters).
Declaration
Objective-C
@property (nonatomic) float accuracy;
Swift
var accuracy: Float { get set }
-
Multiple providers can create locations. This property determines which one has determined the location.
Declaration
Objective-C
@property (nonatomic, strong) NSString *_Nonnull provider;
Swift
var provider: String { get set }
-
Identifier of the device that has generated the location
Declaration
Objective-C
@property (nonatomic, strong) NSString *_Nonnull deviceId;
Swift
var deviceId: String { get set }
-
Return true if the location has a valid rotation matrix, false otherwise.
Declaration
Objective-C
@property (nonatomic) BOOL hasRotationMatrix;
Swift
var hasRotationMatrix: Bool { get set }
-
Return the rotation matrix
Note
If hasRotationMatrix is false the rotation matrix returned could not be reliable.Declaration
Objective-C
@property (nonatomic) CMRotationMatrix rotationMatrix;
Swift
var rotationMatrix: CMRotationMatrix { get set }
-
Return the rotation matrix provider
Declaration
Objective-C
@property (nonatomic) kSITRotationMatrixProvider rotationMatrixProvider;
Swift
var rotationMatrixProvider: kSITRotationMatrixProvider { get set }
-
Method that determines if the location has a high-quality bearing
Declaration
Objective-C
- (BOOL)hasBearing;
Swift
func hasBearing() -> Bool
Return Value
BOOL Location bearinqQuality is high (YES) or not (NO)