Custom routes

VERSION 2.1.2

This guide describes features that are part of the Maps and Navigation SDK Extended flavor, available upon request. Contact us to get started.

Planning a route may involve locations beyond the origin and destination. The route can be constructed as a custom route from a polyline (defined as a list of supporting points). This allows users to import routes from another source or reconstruct driven paths.

The supportingPoints parameter is used to reconstruct a route from an imported polyline:

  • The sequence of supporting points provided is used as input for route reconstruction.
  • Alternative routes are calculated between the origin and destination points specified in the base path parameter locations.
  • If both minDeviationDistance and minDeviationTime are set to zero, the origin and destination points are expected to be at, or very near, the beginning and end of the reference route.
  • The reference route may contain traffic incidents of the type ROAD_CLOSURE, which are ignored when calculating travel time and traffic delays.
1val supportingPoints = loadSupportingPointsFromFile()
2val amsterdam = GeoPoint(52.377956, 4.897070)
3val rotterdam = GeoPoint(51.926517, 4.462456)
4val routePlanningOptions = RoutePlanningOptions(
5 itinerary = Itinerary(origin = amsterdam, destination = rotterdam),
6 routeLegOptions = supportingPoints.map { RouteLegOptions(supportingPoints = it) },
7)

Next steps

Since you have learned how to work with waypoints and supporting points, here are recommendations for the next steps: