HERE iOS SDK Developer's Guide

NMALoggedPositionSource

Class Summary

class NMALoggedPositionSource

Derived from: NSObject, NMAPositionDataSource

A position data source which generates updates from a GPS data log file.

Include: NMAKit.framework/headers/NMALoggedPositionSource.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMALoggedPositionSource

[For complete information, see the section Class Details]

Public Enumeration Summary

Table 1. Public Enumerations
Public Enumerations

NMALoggedPositionUpdateStyle

Deprecated: This is deprecated as of release 3.4.

Represents the methods than can be used to generate logged position updates.

Public Property Summary

Table 2. Public Properties
Public Properties

[readable, assign] NSUInteger  currentPositionIndex

[readable, assign] BOOL  finished

Indicates whether the position source has reached the end of its log file

[readable, writable, assign] float  horizontalAccuracy

Deprecated: This is deprecated as of release 3.4.

The default horizontal accuracy value in meters, used when a log data point does not specify an accuracy

[readable, writable, assign] NSURL *  logFile

The URL of the log file from which position updates are being generated

[readable, writable, assign] BOOL  positionLost

Indicates whether the position source returns valid positions

[readable, assign] NSArray< NMAGeoPosition * > *  positions

The array of NMAGeoPositions loaded from the current logFile, or nil if no file is set

[readable, writable, assign] BOOL  runsInBackground

Indicates whether the position source attempts to keep the application running in the background in order to provide position updates

[readable, writable, assign] BOOL  stationary

Indicates whether or not the simulated positions are moving through the log

[readable, writable, assign] NSTimeInterval  updateInterval

Deprecated: This is deprecated as of release 3.4.

The time interval between successive position updates, in seconds

[readable, writable, assign] NMALoggedPositionUpdateStyle   updateStyle

Deprecated: This is deprecated as of release 3.4.

The update style of the data source; the style controls update frequency

[readable, writable, assign] BOOL  usesOriginalTimestamps

Deprecated: This is deprecated as of release 3.4.

Controls whether or not the log file time stamps are used in position updates.

[readable, writable, assign] float  verticalAccuracy

Deprecated: This is deprecated as of release 3.4.

The default vertical accuracy value in meters, used when a log data point does not specify an accuracy

Instance Method Summary

Table 3. Instance Methods
Instance Method Summary

-(nonnull instancetype) init

Initialize an NMALoggedPositionSource instance

-(nonnull instancetype) initWithLogFile:(nonnull NSURL *) logFile

Initialize a logged position source with the specified log file as input

-(void) reset

Erases all progress through the log

Class Details

A position data source which generates updates from a GPS data log file.

The input source of the position updates is specified using the logFile property. The update frequency can be controlled using the updateStyle and updateInterval properties.

Note:

By default this class generates position updates in the background. See the runsInBackground property.

Public Enumeration Details

NMALoggedPositionUpdateStyle

Deprecated: This is deprecated as of release 3.4.

Represents the methods than can be used to generate logged position updates.

Enumeration Members:

  • NMALoggedPositionUpdateStyleActual

    One update per log entry, spaced according the entry timestamps.

  • NMALoggedPositionUpdateStyleInterpolated

    Updates at a fixed interval, with values interpolated between the two nearest log entries.

  • NMALoggedPositionUpdateStyleFixed

    Updates at a fixed interval, with values from successive log entries (timestamps ignored)

Public Property Details

[readable, assign] NSUInteger currentPositionIndex

The index of the current position within positions

[readable, assign] BOOL finished

Indicates whether the position source has reached the end of its log file.

Note:

Returns NO if the source has not yet been started.

[readable, writable, assign] float horizontalAccuracy

Deprecated: This is deprecated as of release 3.4.

The default horizontal accuracy value in meters, used when a log data point does not specify an accuracy.

Note:

The default value is 5.0 meters.

[readable, writable, assign] NSURL * logFile

The URL of the log file from which position updates are being generated.

Attempts to change the log file after plyabck has started will be ignored. Playback is started when an NMALoggedPositionSource instance is set as the dataSource of NMAPositioningManager.

Note:

Currently, only the GPX file format is supported. GPX files may be generated using NMAPositioningManager and NMADevicePositionSource

[readable, writable, assign] BOOL positionLost

Indicates whether the position source returns valid positions.

Setting positionLost to YES can be used to simulate position loss. Position updates will still be generated by the position source, but the currentPosition property will always return nil.

Note:

Progress through the log will continue regardless of the value of this property.

Note:

The default value is NO.

[readable, assign] NSArray< NMAGeoPosition * > * positions

The array of NMAGeoPositions loaded from the current logFile, or nil if no file is set.

Note:

These objects are not exactly the same as objects returned by currentPosition as the currentPosition may have a different timestamp depending upon the values of usesOriginalTimestamps and updateStyle

[readable, writable, assign] BOOL runsInBackground

Indicates whether the position source attempts to keep the application running in the background in order to provide position updates.

Defaults to YES.

Note:

This class uses CLLocationManager to keep the app running in the background but the positions generated come from the GPS data file.

[readable, writable, assign] BOOL stationary

Indicates whether or not the simulated positions are moving through the log.

If stationary is YES, the currentPosition will remain fixed at the last calculated position, or the beginning of the log file if no progress has been made.

Note:

The default value is NO.

[readable, writable, assign] NSTimeInterval updateInterval

Deprecated: This is deprecated as of release 3.4.

The time interval between successive position updates, in seconds.

If the position update style is interval-based, this property controls the time between updates. If the update style is NMALoggedPositionUpdateStyleActual, this property has no effect.

The minimum value of the property is 0.1 seconds, the default value is 1.0 seconds.

[readable, writable, assign] NMALoggedPositionUpdateStyle  updateStyle

Deprecated: This is deprecated as of release 3.4.

The update style of the data source; the style controls update frequency.

Note:

The default value is NMALoggedPositionUpdateStyleActual.

See also:

NMALoggedPositionUpdateStyle

[readable, writable, assign] BOOL usesOriginalTimestamps

Deprecated: This is deprecated as of release 3.4.

Controls whether or not the log file time stamps are used in position updates.

If this property is set to YES, position values will be created with the time stamp of their corresponding data point in the log file. If this property is NO, the time stamps of the position updates will be calculated relative to the time when position updating was started. The time offset of each data point will be equal to the time difference between that point's timestamp and the timestamp of the first data point in the log file.

Note:

The default value is NO.

[readable, writable, assign] float verticalAccuracy

Deprecated: This is deprecated as of release 3.4.

The default vertical accuracy value in meters, used when a log data point does not specify an accuracy.

Note:

The default value is 5.0 meters.

Instance Method Details

-(nonnull instancetype) init

Initialize an NMALoggedPositionSource instance.

-(nonnull instancetype) initWithLogFile:(nonnull NSURL *) logFile

Initialize a logged position source with the specified log file as input.

-(void) reset

Erases all progress through the log.

Note:

This method will not affect any properties, including the current log file.