Calculating alternative routes
This article discusses the use case of alternative routing. PTV xRoute provides the ability to request several alternative routes in one request.
Benefits
Sometimes, a driver can have a precise knowledge of information which might be missing in the map (traffic lights, traffic incident, damaged road, personal convenience or preference, etc...). The driver could then prefer to take another route than the theoretically optimal one. Therefore PTV xRoute proposes alternative routes of good quality (in regards to the request criteria).
Prerequisites
Check if the following prerequisites are fulfilled before you start with the use case.
- Installed and licensed PTV xRoute and xMap services.
Programming Guide
The following xRoute example show how to request alternative routes.
This example displays the results of a request with alternative routes. For each alternative route basic information such as the traveltime and the route distance and through the corresponding result field the polyline is returned.
The following xRoute example show how to request alternative routes and encoded paths and how to use the returned encoded Path to determine further information such as in this case the carbon emissions.
Related Topics
Showcase | Calculate Alternative routes |
Technical concept | Alternative routes |