RouteObject

Objective-C


@interface RouteObject : NSObject

Swift

class RouteObject : NSObject

This class encapsulates route information.

  • Initializes and returns a newly allocated object using the model data.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithModelData:(nonnull void *)data;
  • Returns the model data.

    Declaration

    Objective-C

    - (nonnull void *)getModelData;
  • The delegate for the route.

    Declaration

    Objective-C

    @property (nonatomic, weak) NSObject<RouteObjectDelegate> *_Nullable delegate;

    Swift

    weak var delegate: (any RouteObjectDelegate)? { get set }
  • Returns true if the route is a Public Transport route.

    Declaration

    Objective-C

    - (BOOL)isPTRoute;

    Swift

    func isPTRoute() -> Bool
  • Returns Public Transport route.

    Declaration

    Objective-C

    - (nullable RouteObject *)toPTRoute;

    Swift

    func toPTRoute() -> RouteObject?
  • Check if the route is an EV route.

    Declaration

    Objective-C

    - (BOOL)isEVRoute;

    Swift

    func isEVRoute() -> Bool
  • Check if the route is an over track route.

    Declaration

    Objective-C

    - (BOOL)isOTRoute;

    Swift

    func isOTRoute() -> Bool
  • Convert to a EVRoute from this one.

    Declaration

    Objective-C

    - (nullable RouteObject *)toEVRoute;

    Swift

    func toEVRoute() -> RouteObject?
  • Convert to an over track route from this one.

    Declaration

    Objective-C

    - (nullable RouteObject *)toOTRoute;

    Swift

    func toOTRoute() -> RouteObject?
  • Returns the list of waypoints. @details The waypoints are ordered like: departure, first waypoint, …, destination.

    Declaration

    Objective-C

    - (nonnull NSArray<LandmarkObject *> *)getWaypoints;

    Swift

    func getWaypoints() -> [LandmarkObject]
  • Returns the list of waypoints.

    Declaration

    Objective-C

    - (nonnull NSArray<LandmarkObject *> *)getWaypoints:
        (RouteWaypointsOption)option;

    Swift

    func getWaypoints(_ option: RouteWaypointsOption) -> [LandmarkObject]

    Parameters

    option.

    See RouteWaypointsOption for details

  • Returns the length in meters and estimated travel time in seconds for the route.

    Declaration

    Objective-C

    - (nullable TimeDistanceObject *)getTimeDistance;

    Swift

    func getTimeDistance() -> TimeDistanceObject?
  • Returns the geographic area of the route. The geographic area is the smallest rectangle that can be drawn around the route.

    Declaration

    Objective-C

    - (nullable RectangleGeographicAreaObject *)getGeographicArea;

    Swift

    func getGeographicArea() -> RectangleGeographicAreaObject?
  • Returns true if traveling the route or route segment incurs cost to the user.

    Declaration

    Objective-C

    - (BOOL)getIncursCosts;

    Swift

    func getIncursCosts() -> Bool
  • Returns the summary of the route.

    Declaration

    Objective-C

    - (nonnull NSString *)getSummary;

    Swift

    func getSummary() -> String
  • Returns the length in meters and estimated travel time in seconds for the route.

    Declaration

    Objective-C

    - (nullable TimeDistanceObject *)getTimeDistanceWithActivePart:(BOOL)activePart;

    Swift

    func getTimeDistance(withActivePart activePart: Bool) -> TimeDistanceObject?

    Parameters

    activePart

    If true, returns only the active part of the route metrics, if false returns whole route metrics.

  • Returns the list of traffic events affecting the route.

    Declaration

    Objective-C

    - (nonnull NSArray<RouteTrafficEventObject *> *)getTrafficEvents;

    Swift

    func getTrafficEvents() -> [RouteTrafficEventObject]
  • Returns the route segment list.

    Declaration

    Objective-C

    - (nonnull NSArray<RouteSegmentObject *> *)getSegments;

    Swift

    func getSegments() -> [RouteSegmentObject]
  • Returns the index of the closest route segment to the given location.

    Declaration

    Objective-C

    - (int)getClosestSegment:(nonnull CoordinatesObject *)location;

    Swift

    func getClosestSegment(_ location: CoordinatesObject) -> Int32
  • Returns true if the route contains ferry connections.

    Declaration

    Objective-C

    - (BOOL)hasFerryConnections;

    Swift

    func hasFerryConnections() -> Bool
  • Returns true if the route contains toll roads.

    Declaration

    Objective-C

    - (BOOL)hasTollRoads;

    Swift

    func hasTollRoads() -> Bool
  • Returns the route status.

    Declaration

    Objective-C

    - (RouteStatus)getStatus;

    Swift

    func getStatus() -> RouteStatus
  • Export route data in the requested data format.

    Declaration

    Objective-C

    - (nullable NSData *)exportAs:(PathFileFormat)format;

    Swift

    func export(as format: PathFileFormat) -> Data?

    Parameters

    format

    Data format, see PathObject, PathFileFormat.

  • Export route data in the requested data format.

    Declaration

    Objective-C

    - (nullable NSData *)exportAs:(PathFileFormat)format
                   withCompresion:(BOOL)compressed;

    Swift

    func export(as format: PathFileFormat, withCompresion compressed: Bool) -> Data?

    Parameters

    format

    Data format, see PathObject, PathFileFormat.

    compressed

    Compression flag.

  • Returns the route terrain profile. @details The setBuildTerrainProfile API must be called on Route Preferences in order for profile to be available.

    Declaration

    Objective-C

    - (nullable RouteTerrainProfileObject *)getTerrainProfile;

    Swift

    func getTerrainProfile() -> RouteTerrainProfileObject?
  • Returns a coordinate on route at the given distance.

    Declaration

    Objective-C

    - (nullable CoordinatesObject *)getCoordinateOnRoute:(int)distance;

    Swift

    func getCoordinateOnRoute(_ distance: Int32) -> CoordinatesObject?
  • Returns a time distance coordinate on route from the given coordinate.

    Declaration

    Objective-C

    - (nullable TimeDistanceCoordinatesObject *)getTimeDistanceCoordinateOnRoute:
        (nonnull CoordinatesObject *)coordinate;

    Swift

    func getTimeDistanceCoordinate(onRoute coordinate: CoordinatesObject) -> TimeDistanceCoordinatesObject?
  • Returns the route distance from departure at the given coordinate.

    Declaration

    Objective-C

    - (int)getDistanceOnRoute:(nonnull CoordinatesObject *)location
                   activePart:(BOOL)activePart;

    Swift

    func getDistanceOnRoute(_ location: CoordinatesObject, activePart: Bool) -> Int32

    Parameters

    activePart

    If true, returns only the active distance part.

  • Returns a path object from the route start - end segment.

    Declaration

    Objective-C

    - (nullable PathObject *)getPath:(int)start end:(int)end;

    Swift

    func getPath(_ start: Int32, end: Int32) -> PathObject?

    Parameters

    start

    The start distance in meters.

    end

    The end distance in meters.

  • Build path from route.

    Declaration

    Objective-C

    - (nullable PathObject *)getPath;

    Swift

    func getPath() -> PathObject?
  • Build a list of timestamp coordinates from a route. @param[in] start Start distance from route start. @param[in] end End distance from route start. @param[in] step The step on which the coordinates are created. @param[in] stepType The step unit type: true = distance in meters, false = time in seconds.

    Declaration

    Objective-C

    - (nonnull NSArray<TimeDistanceCoordinatesObject *> *)
        getTimeDistanceCoordinatesFrom:(int)start
                                   end:(int)end
                                  step:(int)step
                              stepType:(BOOL)stepType;

    Swift

    func getTimeDistanceCoordinates(from start: Int32, end: Int32, step: Int32, stepType: Bool) -> [TimeDistanceCoordinatesObject]

    Return Value

    The result list

  • Get the dominant road names. @details A road is considered dominant when it covers n% from route total length.

    Declaration

    Objective-C

    - (nonnull NSArray<NSString *> *)getDominantRoads;

    Swift

    func getDominantRoads() -> [String]

    Return Value

    The names list. If a road has multiple names, they will be presented as “name1 / name2 / … / namex”

  • Returns the route preferences.

    Declaration

    Objective-C

    - (nullable RoutePreferencesObject *)getPreferences;

    Swift

    func getPreferences() -> RoutePreferencesObject?
  • Get user extra info.

    Declaration

    Objective-C

    - (nullable SearchableParameterListObject *)getExtraInfo;

    Swift

    func getExtraInfo() -> SearchableParameterListObject?
  • Set user extra info.

    Declaration

    Objective-C

    - (void)setExtraInfo:(nonnull SearchableParameterListObject *)list;

    Swift

    func setExtraInfo(_ list: SearchableParameterListObject)
  • Returns true if the current route is equal with route.

    Declaration

    Objective-C

    - (BOOL)isEqualWithRoute:(nonnull RouteObject *)route;

    Swift

    func isEqual(withRoute route: RouteObject) -> Bool