MatchedLocation

public struct MatchedLocation

Part of the MapMatchingResult that represents a single matched position candidate.

This struct encapsulates information about a position that has been matched to the map, including its location, an identifier, a probability score, and other relevant details. It is used in map matching results to provide detailed information about each matched position candidate.

  • Creates a new instance of matched location.

    Declaration

    Swift

    public init(
        location: GeoLocation,
        id: Int = 0,
        probability: Measurement<TTUnitRatio> = .tt.percent(0),
        isOnRoad: Bool = false,
        direction: Measurement<UnitAngle> = .tt.degrees(0)
    )

    Parameters

    location

    The GeoLocation that was matched on the map.

    id

    Identifier of this matched position candidate.

    probability

    The score of the matched position in range 0-100.

    isOnRoad

    The flag indicating whether the matched position candidate is on the road.

    direction

    The direction of the line segment in degrees clockwise from North.

  • The GeoLocation that was matched on the map.

    Declaration

    Swift

    public let location: GeoLocation
  • id

    Identifier of the matched position candidate.

    The identifier of this matched position candidate. For the best matches, the id will change when the map matcher detects a matching error and applies a correction. For alternative matches, the behavior depends on the underlying matching algorithm and is generally not guaranteed.

    Declaration

    Swift

    public let id: Int
  • The score of the matched position in range 0-100.

    Represents the probability score of the matched position, indicating the confidence level of the map matching algorithm in the range of 0 to 100.

    Declaration

    Swift

    public let probability: Measurement<TTUnitRatio>
  • The flag indicating whether the matched position candidate is on the road.

    Declaration

    Swift

    public let isOnRoad: Bool
  • The direction of the line segment on which the location is matched in degrees clockwise from North.

    It can be either the input heading from MapMatchingResult.rawLocation, or the direction of the closest road.

    Declaration

    Swift

    public let direction: Measurement<UnitAngle>