Importing long-haul routes

Introduction

Itinerary long-haul routes (a.k.a precomputed routes) is the feature, which allows Sygic navigation to load the routes created in an external system. This type of routes is primarily meant for long-haul navigation, and it is a category of guided routes.
Guided route is basically a sequence of GPS positions, typically extended with waypoints indicating significant points on route (typically pickup/delivery points). Such routes can be loaded into navigation using the API function LoadComputedRoute.
Sygic navigation internally runs the route approximation algorithm, which performs map matching of that GPS sequence to currently installed Sygic maps to generate a navigable route. Once the route is generated Sygic navigation follows the route in a magnetic way.

Feature characteristics

Waypoints and Points

The route structure is defined with the waypoints and points (a.k.a magnetics points).
The waypoints must be visited as they typically define significant points for customer visit, or pickup/delivery points. The visit is acknowledged when vehicles passes its GPS position with the sufficient proximity (radius in meters is set to 50 meters and adaptively increased with a vehicle speed). If a waypoint is not visited with a sufficient proximity you may encounter navigation recalculations asserting on passing the waypoint position on and on (unless you apply the explicit operation skip waypoint).
On the contrary magnetic points only define a desired prescription of the routing and there is no such thing as radius definition for them. Navigation tries to do its best to follow directions of the magnetic points but there is no obligation to pass them with a predefined vicinity. If a driver makes a deviation on the route (by mistake or deliberately due to some obstacle) the navigation tries its best to get driver back on route with the possible outcome that some magnetic points were automatically skipped.

Waypoint types

Our precomputed route format currently supports only the template START – VIA ... VIA – DEST, where START and DEST are mandatory, and you may have 0 to many VIA waypoints.
The assumption is that START is a vehicle‘s current position, typically represented by a depot. And the first VIA is actually the first customer to be visited for pickup or delivery.
DEST might be considered as the last customer for visit, or a depot for vehicle.

Start waypoint

START is a specially handled waypoint, which does not need to be defined with a high precision. Actually it is also ok if it is relatively far from a real start.
During the execution of a route by Sygic navigation the start is replaced with an actual GPS position once the Sygic navigation app gets a GPS fix. This means that if your originally defined START position is close to the actual GPS position everything looks perfect. In case the originally defined START position is far from the actual GPS position then the route to the first VIA point might be significantly recalculated, but we consider this as a desired behavior.
So in short, during the navigation execution START is basically dropped and it is replaced by an actual GPS position. The importance of the START to be realistically defined is that you can calculate your route costs in office through your route planner, where you should make some assumptions where your vehicle is currently located (that is START).

Truck attributes

The Sygic route import algorithm (approximation) originally ignores truck parameters. We make the assumption that the computed route comes from a system that can compute truck routes, like PTV. Of course, when a driver deviates from the route and the navigation searches for a way how to join back the original route, it takes the currently set truck restrictions into account.

Approximation criteria

Since the input GPS sequence can be of a various precision it is not always possible to finish approximation successfully.
It is always best if the precision of GPS sequencing is maximally close to the position of Sygic maps.
The ideal situation is if the route generated from the external system and Sygic navigation use the same maps (map provider and version release), e.g. Tomtom or Here.
At the same time it is also important that there are no big distances between consecutive gps points.
For successful approximation we define the following criteria:

  • the distance period between two consecutive GPS points should not exceed 200m
    This obviously is more important around complex crossings.
    On highways and long non-intersection roads the condition can be relaxed.
    Based on our experiences the range 20m to 500m distances works well.
  • the error variance from the underlying Sygic maps should not exceed 20m
    This obviously is more important around complex crossings. On highways and long non-intersection roads the condition can be relaxed.

SDK supported functions

There is the SDK function LoadComputedRoute, through which the guided route (precomputed route) can be injected into navigation.
Please note that this function requires a special licensing permission appearing as precomputedRoutes=yes in your license file. If your license does not contain the permission the function returns the exception license error.
Please check the details in Routing API for Android and Routing API for Windows.

Route formats

Currently we support two formats: Sygic-native format (sif files) and PTV-compatible format, both the variants of json.
Sygic SDK function automatically recognizes the used format.
Please check the details of the formats in Routing API section Json Route object

Usage example

The sample code imports a route from a file and gets into the navigation mode.

void demo()
{
    String filename = getSdcardStorage() + "/routes/route_66.json";
    try {
        ApiNavigation.loadComputedRoute(filename, 0);
    } catch (LoadRouteException e) {
        e.printStackTrace();
    }
}