RoadObjectMatcher

final public class RoadObjectMatcher

Provides methods for road object matching.

Matching results are delivered asynchronously via a delegate. In case of error (if there are no tiles in the cache, decoding failed, etc.) the object won’t be matched.

Note

The Mapbox Electronic Horizon feature of the Mapbox Navigation SDK is in public beta and is subject to changes, including its pricing. Use of the feature is subject to the beta product restrictions in the Mapbox Terms of Service. Mapbox reserves the right to eliminate any free tier or free evaluation offers at any time and require customers to place an order to purchase the Mapbox Electronic Horizon feature, regardless of the level of use of the feature.
  • Matches given OpenLR object to the graph.

    Declaration

    Swift

    public func matchOpenLR(location: String, identifier: OpenLRIdentifier)

    Parameters

    location

    OpenLR location of the road object, encoded in a base64 string.

    identifier

    Unique identifier of the object.

  • Matches given polyline to the graph. Polyline should define a valid path on the graph, i.e. it should be possible to drive this path according to traffic rules.

    Declaration

    Swift

    public func match(polyline: LineString, identifier: RoadObject.Identifier)

    Parameters

    polyline

    Polyline representing the object.

    identifier

    Unique identifier of the object.

  • Matches a given polygon to the graph. “Matching” here means we try to find all intersections of the polygon with the road graph and track distances to those intersections as distance to the polygon.

    Declaration

    Swift

    public func match(polygon: Polygon, identifier: RoadObject.Identifier)

    Parameters

    polygon

    Polygon representing the object.

    identifier

    Unique identifier of the object.

  • Matches given gantry (i.e. polyline orthogonal to the road) to the graph. “Matching” here means we try to find all intersections of the gantry with the road graph and track distances to those intersections as distance to the gantry.

    Declaration

    Swift

    public func match(gantry: MultiPoint, identifier: RoadObject.Identifier)

    Parameters

    gantry

    Gantry representing the object.

    identifier

    Unique identifier of the object.

  • Matches given point to road graph.

    Declaration

    Swift

    public func match(point: CLLocationCoordinate2D, identifier: RoadObject.Identifier, heading: CLHeading? = nil)

    Parameters

    point

    Point representing the object.

    identifier

    Unique identifier of the object.

    heading

    Heading of the provided point, which is going to be matched.

  • Cancel road object matching.

    Declaration

    Swift

    public func cancel(identifier: RoadObject.Identifier)

    Parameters

    identifier

    Identifier for which matching should be canceled.