MapMatchedLocation
public struct MapMatchedLocation : Hashable
Describes a map-matched location in the world at a given time.
-
The geographic coordinates of the map-matched location.
Declaration
Swift
public var coordinates: GeoCoordinates -
The bearing orientation points to the direction of travel, and has the same angle as the street where it is matched to. Therefore, it must not necessarily be the same as the bearing of a location source. Starts at 0 in the geographic north and rotates in a clockwise direction around the compass. It means that for going north it’s equal to 0, for northeast it’s equal to 45, for east it’s equal to 90, and so on. If it cannot be determined, the value is
nil. Otherwise, it is guaranteed to be in the range [0, 360).Declaration
Swift
public var bearingInDegrees: Double? -
Reference to the current segment. The ratio of
MapMatchedLocation.segmentOffsetInCentimetersto the segment length is betweenSegmentReference.offsetStartandSegmentReference.offsetEnd.Declaration
Swift
public var segmentReference: SegmentReference -
Offset from start of segment in centimeters.
Declaration
Swift
public var segmentOffsetInCentimeters: UInt32 -
Confidence level (between 0 and 1) of the matched location. A low confidence value means that the map-matched vehicle location is not reliable and it may not be clear which part of the road the vehicle has taken. This can happen when the accuracy or frequency of the provided location updates is poor. If the confidence level is too small then, for example, overspeed warnings may be also inaccurate.
Declaration
Swift
public var confidence: Double -
Determines if the travel direction on a one-way street is against the allowed traffic direction. For two-way streets, this value is always
false. This feature is supported in tracking mode and when deviating from a route. Note that the travel direction is determined based on the map-matched location.Declaration
Swift
public var isDrivingInTheWrongWay: Bool -
Horizontal accuracy measure of location. Estimated based on accuracy of input location and confidence of this map-matched location. Currently this value is not being provided by the Navigator.
Declaration
Swift
public var horizontalAccuracyInMeters: Double? -
Speed in meters per second.
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
Declaration
Swift
public var speedInMetersPerSecond: Double? -
Timestamp of the map matched position.
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
Declaration
Swift
public var timestamp: Date? -
init(coordinates:bearingInDegrees: segmentReference: segmentOffsetInCentimeters: confidence: isDrivingInTheWrongWay: horizontalAccuracyInMeters: speedInMetersPerSecond: timestamp: ) Creates a new instance.
Parameters
- coordinates: The geographic coordinates of the map-matched location.
- bearingInDegrees: The bearing orientation points to the direction of travel, and has the same angle as the
street where it is matched to. Therefore, it must not necessarily be the same as the
bearing of a location source.
Starts at 0 in the geographic north and rotates in a clockwise direction around the
compass. It means that for going north it’s equal to 0, for northeast it’s equal to 45,
for east it’s equal to 90, and so on.
If it cannot be determined, the value is
nil. Otherwise, it is guaranteed to be in the range [0, 360). - segmentReference: Reference to the current segment.
The ratio of
MapMatchedLocation.segmentOffsetInCentimetersto the segment length is betweenSegmentReference.offsetStartandSegmentReference.offsetEnd. - segmentOffsetInCentimeters: Offset from start of segment in centimeters.
- confidence: Confidence level (between 0 and 1) of the matched location. A low confidence value means that the map-matched vehicle location is not reliable and it may not be clear which part of the road the vehicle has taken. This can happen when the accuracy or frequency of the provided location updates is poor. If the confidence level is too small then, for example, overspeed warnings may be also inaccurate.
- isDrivingInTheWrongWay: Determines if the travel direction on a one-way street is against the allowed traffic direction.
For two-way streets, this value is always
false. This feature is supported in tracking mode and when deviating from a route. Note that the travel direction is determined based on the map-matched location. - horizontalAccuracyInMeters: Horizontal accuracy measure of location. Estimated based on accuracy of input location and confidence of this map-matched location. Currently this value is not being provided by the Navigator.
- speedInMetersPerSecond: Speed in meters per second.
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
- timestamp: Timestamp of the map matched position.
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
Declaration
Swift
public init(coordinates: GeoCoordinates, bearingInDegrees: Double? = nil, segmentReference: SegmentReference = SegmentReference(), segmentOffsetInCentimeters: UInt32 = 0, confidence: Double = 0.0, isDrivingInTheWrongWay: Bool = false, horizontalAccuracyInMeters: Double? = nil, speedInMetersPerSecond: Double? = nil, timestamp: Date? = nil)