Skip to main content

Routes

Last updated: April 9, 2026 | 12 minutes read

A route represents a navigable path between two or more landmarks (waypoints), including distance, estimated time, and navigation instructions.

Compute routes in different ways:

  • Waypoint-based - Based on 2 or more landmarks (navigable)
  • Over-track - Based on a predefined path from GPX files or other sources (navigable)
  • Route ranges - Not navigable, without segments or instructions

Navigable routes consist of segments. Each segment represents the portion between consecutive waypoints with its own route instructions.

Create Routes

Routes cannot be instantiated directly. Compute them based on a list of landmarks. See Get started with Routing for details.

danger

Calculating a route does not automatically display it on the map. See Display routes for instructions.

Route types

The iOS SDK supports standard, public transport, over-track, and EV route variants.

Route typeType checks and conversionClass
Normal routedefault RouteObjectRouteObject
Public transportisPTRoute() and toPTRoute()PTRouteObject
Over-trackisOTRoute() and toOTRoute()OTRouteObject
Electric vehicleisEVRoute() and toEVRoute()EVRouteObject
func inspectType(route: RouteObject) {
if route.isPTRoute(), let ptRoute = route.toPTRoute() as? PTRouteObject {
print("PT fare: \(ptRoute.getPTFare())")
} else if route.isOTRoute(), let otRoute = route.toOTRoute() as? OTRouteObject {
print("OT route has track: \(otRoute.getTrack() != nil)")
} else if route.isEVRoute(), route.toEVRoute() is EVRouteObject {
print("EV route detected")
} else {
print("Standard route")
}
}

RouteObject structure

RouteObject is the shared contract for all route types.

Core methods

MethodReturn typeDescription
getWaypoints()[LandmarkObject]Route waypoints in order: departure, intermediates, destination
getWaypoints(_:)[LandmarkObject]Waypoints filtered by RouteWaypointsOption
getTimeDistance()TimeDistanceObject?Total route metrics
getTimeDistance(withActivePart:)TimeDistanceObject?Metrics for active/remaining part or full route
getGeographicArea()RectangleGeographicAreaObject?Bounding rectangle for the route
getSummary()StringHuman-readable summary
getSegments()[RouteSegmentObject]Segment list
getTrafficEvents()[RouteTrafficEventObject]Traffic events affecting the route
getStatus()RouteStatusRoute lifecycle state
getIncursCosts()BoolCost-incurring flag
hasFerryConnections()BoolWhether ferry segments are present
hasTollRoads()BoolWhether toll roads are present
func summarize(route: RouteObject) {
print("Summary: \(route.getSummary())")
print("Waypoint count: \(route.getWaypoints().count)")

if let td = route.getTimeDistance() {
print("Distance (m): \(td.getTotalDistance())")
print("Duration (s): \(td.getTotalTime())")
}

print("Has toll roads: \(route.hasTollRoads())")
print("Has ferry connections: \(route.hasFerryConnections())")
}

Geometry, sampling, and export

MethodReturn typeDescription
getPath()PathObject?Full route geometry
getPath(_:end:)PathObject?Geometry subset between two distances
getCoordinateOnRoute(_:)CoordinatesObject?Coordinate sampled at distance from start
getClosestSegment(_:)Int32Closest segment index to a coordinate
getDistanceOnRoute(_:activePart:)Int32Distance from departure to location
getTimeDistanceCoordinateOnRoute(_:)TimeDistanceCoordinatesObject?Distance/time-aligned coordinate on route
getTimeDistanceCoordinates(from:end:step:stepType:)[TimeDistanceCoordinatesObject]Distance or time-stepped route sampling
export(as:)Data?Exports route geometry in a path file format
export(as:withCompresion:)Data?Export with compression flag
getDominantRoads()[String]Main roads covering the route

Preferences and metadata

MethodReturn typeDescription
getTerrainProfile()RouteTerrainProfileObject?Elevation/slope analytics if enabled in preferences
getPreferences()RoutePreferencesObject?Route preferences used for computation
getExtraInfo()SearchableParameterListObject?User metadata bag
setExtraInfo(_:)VoidSets custom metadata
isEqualWithRoute(_:)BoolEquality check against another route

RouteWaypointsOption

ValueDescription
RouteWaypointsOptionInitialInitial waypoints used at first route calculation
RouteWaypointsOptionRemainingInitialRemaining initial waypoints (passed intermediates removed)
RouteWaypointsOptionRemainingRemaining waypoints including service-added entries

RouteStatus

ValueDescription
RouteStatusUninitializedRoute object has no ready data
RouteStatusCalculatingCalculation in progress
RouteStatusWaitingInternetConnectionWaiting for connectivity
RouteStatusReadyRoute data is ready
RouteStatusErrorCalculation failed

Sample route geometry and export

if let path = route.getPath() {
print("Route points: \(path.getCoordinates().count)")
}
if let gpxData = route.export(as: .gpx) {
print("Exported GPX size: \(gpxData.count) bytes")
}
if let point = route.getCoordinateOnRoute(2_000) {
print("Coordinate at 2km: \(point.latitude), \(point.longitude)")
}
let samples = route.getTimeDistanceCoordinates(from: 0, end: 5_000, step: 500, stepType: true)
for sample in samples {
print("distance=\(sample.getDistance()) ts=\(sample.getTimestamp())")
}

RouteSegmentObject structure

A RouteSegmentObject represents the route portion between two consecutive waypoints.

MethodReturn typeDescription
getWaypoints()[LandmarkObject]Segment departure and destination waypoints
getTimeDistance()TimeDistanceObject?Segment distance and travel time
getGeographicArea()RectangleGeographicAreaObject?Segment bounding rectangle
getIncursCosts()BoolSegment cost-incurring flag
getSummary()StringSegment summary text
getInstructions()[RouteInstructionObject]Segment turn instructions
getPTInstructions()[PTRouteInstructionObject]PT instruction list
isCommon()BoolSegment mode matches parent route mode
for (index, segment) in route.getSegments().enumerated() {
print("Segment \(index): \(segment.getSummary())")

if let td = segment.getTimeDistance() {
print(" \(td.getTotalDistance()) m / \(td.getTotalTime()) s")
}

for instruction in segment.getInstructions() {
print(" - \(instruction.getTurnInstruction())")
}
}

RouteInstructionObject structure

RouteInstructionObject provides maneuver details, signposts, and road metadata.

MethodReturn typeDescription
getCoordinates()CoordinatesObjectInstruction location
getCountryCodeISO()StringISO country code
getTurnInstruction()StringManeuver text
getTurnDetails()TurnDetailsObject?Turn detail metadata
getTurnImage(_:)UIImage?Turn image at requested size
hasTurnInfo()BoolTurn info availability
getFollowRoadInstruction()StringFollow-road text
hasFollowRoadInfo()BoolFollow-road availability
getSignpostInstruction()StringSignpost text
getSignpostDetails()SignpostDetailsObject?Signpost detail object
hasSignpostInfo()BoolSignpost availability
getRoadInfo()[RoadInfoObject]Road metadata list
getRoadInfoImage(_:)UIImage?Road info rendered image
hasRoadInfo()BoolRoad info availability
getTimeDistanceToNextTurn()TimeDistanceObject?Remaining metrics to next maneuver
getRemainingTravelTimeDistance()TimeDistanceObject?Remaining metrics to destination
getRemainingTravelTimeDistanceToNextWaypoint()TimeDistanceObject?Remaining metrics to next waypoint
getTraveledTimeDistance()TimeDistanceObject?Traveled metrics
getExitDetails()StringExit details text
isExit()BoolMain-road exit flag
isFerry()BoolFerry instruction flag
isTollRoad()BoolToll-road instruction flag
isCommon()BoolShares parent route transport mode
isEV()BoolInstruction belongs to EV route
info

RouteInstructionObject is route-overview data. For live, position-dependent turn guidance during navigation, use NavigationInstructionObject.

if let instruction = route.getSegments().first?.getInstructions().first {
print(instruction.getTurnInstruction())

let turnImage = instruction.getTurnImage(CGSize(width: 64, height: 64))
print("Turn image available: \(turnImage != nil)")

if instruction.hasRoadInfo() {
print("Road info count: \(instruction.getRoadInfo().count)")
}
}

Public transport route extensions

PTRouteObject

PTRouteObject adds transit-specific details on top of RouteObject.

MethodReturn typeDescription
getPTFare()StringFare text
getPTFrequency()IntFrequency value
getPTRespectsAllConditions()BoolWhether all PT preferences are met
getCountBuyTicketInformation()IntTicket info entry count
getBuyTicketURL(_:)StringTicket purchase URL for entry index
getSolutionPartIndexes(_:)[NSNumber]Route-solution part indexes for ticket info
if route.isPTRoute(), let ptRoute = route.toPTRoute() as? PTRouteObject {
print("Fare: \(ptRoute.getPTFare())")
print("Frequency: \(ptRoute.getPTFrequency())")

let ticketInfoCount = ptRoute.getCountBuyTicketInformation()
for i in 0..<ticketInfoCount {
let index = Int32(i)
print("Ticket URL: \(ptRoute.getBuyTicketURL(index))")
print("Affected parts: \(ptRoute.getSolutionPartIndexes(index))")
}
}

PTRouteSegmentObject

PTRouteSegmentObject provides schedule, agency, line, and realtime details.

MethodReturn typeDescription
getName()StringSegment/display name
getShortName()StringSegment short name
getPlatformCode()StringPlatform code
getDepartureTime() / getArrivalTime()TimeObject?Raw departure/arrival times
getDepartureTimeFormatted() / getArrivalTimeFormatted()StringFormatted time strings
getAgencyName()StringAgency name
getAgencyPhone() / getAgencyUrl() / getAgencyFareUrl()StringAgency contact and fare URLs
getLineFrom() / getLineTowards()StringTransit line origin/destination
getTransitType()TransitTypeTransport mode (walk, bus, tram, etc.)
getRealtimeStatus()RealtimeStatusDelay/on-time/unknown status
getDepartureDelayInSeconds() / getArrivalDelayInSeconds()Int32Delay values in seconds
getHasWheelchairSupport() / getHasBicycleSupport()BoolAccessibility/bike support flags
getStayOnSameTransit()BoolStay-on-vehicle indicator
getLineColor() / getLineTextColor()UIColorLine rendering colors
getCountAlerts()Int32Alert count for segment
isSignificant()BoolIndicates if segment is worth surfacing in UI

PTRouteInstructionObject

MethodReturn typeDescription
getName()StringPT instruction label
getPlatformCode()StringPlatform code
getArrivalTime() / getDepartureTime()TimeObject?PT arrival/departure data
getHasWheelchairSupport()BoolAccessibility support flag

Route traffic updates via delegate

Assign RouteObjectDelegate when you need route-level traffic update callbacks.

Delegate callbackDescription
routeObject(_:onTrafficEventsUpdated:)Called when route traffic events change; includes delay difference
routeObject(_:onTrafficEventsAlongRoute:)Called when traffic-event verification status changes
final class RouteObserver: NSObject, RouteObjectDelegate {
func routeObject(_ route: RouteObject, onTrafficEventsUpdated delayDiff: Int32) {
print("Route delay delta: \(delayDiff) s")
}

func routeObject(_ route: RouteObject, onTrafficEventsAlongRoute checked: Bool) {
print("Traffic events verified: \(checked)")
}
}

TimeDistanceObject

TimeDistanceObject is used across route, segment, and instruction APIs.

MethodReturn typeDescription
getTotalTime() / getTotalDistance()UInt32Total duration/distance
getUnrestrictedTime() / getUnrestrictedDistance()UInt32Public-road travel metrics
getRestrictedTime() / getRestrictedDistance()UInt32Restricted-road metrics
getRestrictedTimeAtBegin() / getRestrictedTimeAtEnd()UInt32Restricted-time split over begin/end
getRestrictedDistanceAtBegin() / getRestrictedDistanceAtEnd()UInt32Restricted-distance split over begin/end
getTotalDistanceMeasurement()Measurement<UnitLength>Measurement object with unit support
getTotalDistanceFormatted() / getTotalDistanceUnitFormatted()StringLocalized distance value/unit
getTotalTimeFormatted() / getTotalTimeUnitFormatted()StringLocalized time value/unit
getFormattedDistance(_:) / getFormattedDistanceUnit(_:)StringFormatted value/unit for arbitrary meters

TurnDetailsObject

MethodReturn typeDescription
getEvent()TurnTypeTurn event enum
getAbstractGeometry()AbstractGeometryObject?Vector geometry for turn
getAbstractGeometryImage()AbstractGeometryImageObject?Renderable abstract geometry image
getRoundaboutExitNumber()Int32Exit number or -1 if unavailable
getTurnImage(_:colorActiveInner:colorActiveOuter:colorInactiveInner:colorInactiveOuter:)UIImage?Color-customized turn image
getTurnImageId()Int32Turn image ID
getTurnId32() / getTurnId64()TurnSimplifiedType32 / TurnSimplifiedType64Simplified maneuver IDs

let scale = UIScreen.main.scale
let imgSize = CGSize.init(width: 40.0 * scale, height: 40.0 * scale)

turnDetailsObject.getTurnImage(imgSize,
colorActiveInner: UIColor.white,
colorActiveOuter: UIColor.black,
colorInactiveInner: UIColor.lightGray,
colorInactiveOuter: UIColor.lightGray)

turnDetailsObject.getTurnImage(imgSize,
colorActiveInner: UIColor.red,
colorActiveOuter: UIColor.green,
colorInactiveInner: UIColor.blue,
colorInactiveOuter: UIColor.yellow)
Turn Image with basic colors
Turn Image with customized colors

SignpostDetailsObject

Signposts near roadways indicate intersections and directions. The SDK provides realistic image renderings with additional information.

Signpost image captured during highway navigation
MethodReturn typeDescription
getItems()[SignpostItemObject]Signpost elements
hasBorderColor() / getBorderColor()Bool / UIColorBorder color availability/value
hasTextColor() / getTextColor()Bool / UIColorText color availability/value
hasBackgroundColor() / getBackgroundColor()Bool / UIColorBackground color availability/value
getImage(_:)UIImage?Rendered signpost image

RouteTerrainProfileObject

If route preferences enabled terrain profile generation, getTerrainProfile() returns this object.

MethodReturn typeDescription
getMinElevation() / getMaxElevation()FloatMin/max elevation
getMinElevationDistance() / getMaxElevationDistance()Int32Distances for min/max elevation points
getTotalUp() / getTotalDown()FloatTotal ascent/descent
getTotalUp(_:end:) / getTotalDown(_:end:)FloatAscent/descent for route range
getElevationSamples(_:)[NSNumber]Elevation sample list
getElevationSamples(_:distBegin:distEnd:)[NSNumber]Elevation samples for route subsection
getElevation(_:)FloatElevation at distance
getClimbSections()[ClimbSectionObject]Climb sections
getSurfaceSections()[SurfaceSectionObject]Surface type sections
getRoadTypeSections()[RoadTypeSectionObject]Road type sections
getSteepSections(_:)[RoadSteepSectionObject]Steepness-classified sections
getElevationChartMinValueY() / getElevationChartMaxValueY()FloatChart range helpers

RouteTrafficEventObject

RouteTrafficEventObject extends traffic-event data with route-relative context.

MethodReturn typeDescription
getDistanceToDestination()Int32Distance from event to destination
getFrom() / getTo()CoordinatesObject?Event start/end coordinates
getFromLandmark() / getToLandmark()LandmarkObject?Event start/end landmarks
hasTrafficEventOnDistance(_:)BoolWhether event affects the remaining route distance
isInsideTrafficEventOnDistance(_:)BoolWhether the point is inside event impact zone
getDistanceFormatted() / getDistanceUnitFormatted()StringFormatted event distance
getDelayTimeFormatted() / getDelayTimeUnitFormatted()StringFormatted delay time
getDelayDistanceFormatted() / getDelayDistanceUnitFormatted()StringFormatted delay distance

Use RouteObject as the base route contract, then branch to PTRouteObject, OTRouteObject, or EVRouteObject only when route-type-specific behavior is needed.