Reference routes
Since a long time the MapTrip SDK provides the opportunity of using reference routes. You can force the SDK routing, to calculate a route along the reference route (RR). A RR is a csv file, that contains just points of a polyline in WGS coordinates, delimited by semicolon.
Format of CSV File
1 2 3 4 5 6 7 8 9 10 | |
There are two ways, how to activate a RR.
Reference routing by getting destination from the RR
Get all (way-) points of this file by
1 | |
Get the last waypoint:
1 2 3 4 | |
The waypoint wptLast has already a user attribute called "refRouteFile". This string attribute contains the path to the csv file.
Add the waypoint to (a new) itinerary.
1 2 | |
Now you can start a new navigation with this itinerary. The route and all reroutes for this navigation are calculated along the RR.
Reference routing with a destination, that is not part of the RR
Create a destination waypoint with the mandatory attributes
1 2 3 4 5 | |
Add the waypoint to (a new) itinerary.
1 2 | |
Now you can start a new navigation with this itinerary.
The route and all reroutes for this navigation are calculated along the RR.
Good to know
- If the RR is very long, the route calculation needs more time!
- If there are circles in the RR, the calculated route does not use these circles.
The routing always tries to find the fastest way along the RR. - If there are restrictions along the RR, the routing will not unblock it. They will be bypassed instead.
- The special parameters for the reference routing must be set at the last waypoint of the itinerary.