With which speeds are the driving times of the routes calculated?
There are several different sources for vehicle speeds. Generally, historical traffic data, a.k.a. traffic patterns, are used to provide accurate speed information depending on the time of day when a road is passed. For traffic-independent route calculation, i.e. for options[trafficMode]=AVERAGE without a start or arrival time, average speeds per vehicle are assigned to the roads in the map which can also be modified by request.
Can I modify the speeds of the vehicle?
For traffic-independent route calculation the speed ranges for each road category can be specified in detail through routeOptions.speedsByRoadCategory when using the operation calculateRoutePost. This is useful when the default speed ranges of the vehicle are not sufficient to implement the use case, for example, when a transport requires lower speeds, when the local traffic situation is different, or the vehicle can drive at other speeds for any reason.
The speedsByRoadCategory cannot be specified with traffic-dependent route calculation as the speed from the traffic patterns will be used, i.e., if options[trafficMode] is REALISTIC, or if is AVERAGE with start or arrival time being specified.
The roads of the map are divided into 8 road categories and each of them is in turn divided into several speed classes. The speed to calculate the driving time is determined from the interval [minimumSpeed, maximumSpeed] of the road category and depending on the speed class. The lowest speed class is assigned the minimum speed, the highest one the maximum speed. The speed of speed classes in-between are calculated by linear interpolation.
Changing the speedsByRoadCategory can also have an impact on the route path as increasing speeds on minor roads will usually prefer shorter routes as the driving time will decrease. The same applies for decreasing speeds on major roads.
The default values can be requested from the Data API and are listed on the Profiles page. In the showcase speeds can be modified interactively to see the impact on the route path.
To modify the speeds for traffic-dependent route calculation, consider using options[speedFactor]. There is no way to modify speeds by road category. See also Traffic Modes.
What other parameters have an influence on the speeds?
With the parameter options[maximumSpeed] it is possible to limit the maximum speed [km/h] of the vehicle. This maximum speed is applied to all kinds of data including traffic patterns. This can have a direct impact on the route path for example when reducing the speed such that highways are as fast as trunk roads. Then, the route distances may decrease as detours on highways and motorways will no longer be faster.
A sophisticated detail is when speedsByRoadCategories is specified and options[maximumSpeed] is not specified and the vehicle's default maximum speed is less than the the greatest of all speedsByRoadCategories. In this case the maximum speed will be assumed to be the greatest of all speedsByRoadCategories.
Another detail is when options[maximumSpeed] is specified and its value is less than the greatest of all speedsByRoadCategories. In that case the maximum speeds by road category will not be reduced to options[maximumSpeed]. Instead the speed is calculated as usual, but will be limited to options[maximumSpeed].
Another parameter related to the speed of the vehicle is options[speedFactor]. In contrast to the ones above this parameter does not influence the route path. Instead, the speed on all roads the route passes will be scaled with the value of the parameter and the driving times will be recalculated with the new speed value. The requested results will be calculated according to the new driving times. When specifying both parameters the effective maximum speed is options[maximumSpeed] * options[speedFactor] as the speed factor is applied after the actual route calculation.
Limitations
The parameter speedsByRoadCategory will have longer response times. When using these parameters, the air-line distance of all waypoints in a request is limited to 10000 km. Additionally, the air-line distance between any two consecutive waypoints must not exceed 3000 km.
The parameter options[maximumSpeed] is also available in the request body in routeOptions.maximumSpeed of the operation calculateRoutePost for compatibility reasons. Make sure that only one of them is specified in the request.
Try it in the Speeds code sample.