PTV xRoute calculates the shortest routeA route corresponds to a path of a vehicle through the underlying transport network. The main attributes of a route are the distance and the time that the vehicle travels along the path. according to predefined criteria. However, it could happen that the user would prefer another route for various reasons (traffic lights, traffic incident, damaged road, personal convenience or preference, etc...). Alternative routes have slightly higher costs than the optimal one but it can turn out that they are shorter or faster. The PTV xRoute service offers up to 3 alternatives for a route.
Alternative routes are not enabled by default. To receive them, the user has to set the result field for alternative routes to true.
According to the technical concept on Route Selection the best route is the route with minimal abstract costs. Hence, the returned alternatives have higher abstract costs and therefore usually are longer in either travel time, route distance or both.
Alternatives with only slightly higher costs are often very similar to the main route and therefore often not considered as an interesting alternative. On the other hand alternatives that share very little with the optimal route often take a very large detour. Our implementation makes a trade-off between the sharing with the main route and large detours.
If requested, additional traveltimes incurred by breaks, rests and service times are also included in the traveltime of the alternatives. However, tour reports or tour events can only be returned through a second request with an encoded path.
This feature cannot be used in combination with high performance routing.
Alternative routes can only be requested for a route containing exactly 2 waypointsA waypoint is a geographic location used to specify start, destination and possible stopovers for a route..
The exact time consideration modes are supported with this feature, however as the route calculation uses an approximation, it can happen the main route is different to the route result computed without alternatives. In such cases it is most likely that the original optimal route is among the alternatives. The reported travel times are always exact for the calculated routes.
Showcase | Calculate Alternative routes |
Technical concept | Route Selection |
Integration sample | Calculating alternative routes |