By default, the route is optimized for travel time, the result is a fast route which prefers routes with longer distances, but lower travel times over routes with shorter distances at higher travel times. This default is represented by options[routingMode]=FAST and tuned to calculate practical routes a real driver would follow.
Set options[routingMode]=SHORT to obtain routes optimized for short distances, i.e. preferring routes with shorter distances, but higher travel times over routes with longer distances at lower travel times.
Use options[routingMode]=SHORTEST for an even more aggressive distance optimization. This can lead to significantly higher travel times if a route reduces the distance substantially (e.g., by taking smaller roads). This feature might be useful for accounting, cost calculations, and regulatory compliance, where the shortest theoretical route is required.
It is also possible to optimize the route for monetary costs based on distance, working time and toll costs. See the Monetary Costs concept.
All three routing modes—FAST, SHORT, and SHORTEST—do not strictly calculate the absolutely fastest or shortest routes. The results remain meaningful and avoid excessive use of rural roads or travel through residential areas. When using SHORTEST, the algorithm may take smaller roads more frequently to reduce route distance, but will still avoid invalid or obviously impractical roads whenever possible.
Custom Time-Distance Weighting
The options[routingMode] parameter provides predefined presets for time-distance optimization. For more fine-grained control, the parameter timePreferenceOverDistance allows you to set a custom weighting between travel time and travel distance on a scale from 0 to 100:
0 — Route is optimized purely for shortest distance.
100 — Route is optimized purely for shortest travel time.
1–99 — A weighted combination of travel time and distance, with higher values giving more importance to travel time.
This parameter is only available through the POST operation calculateRoutePost, as part of the routeOptions object in the request body.
Practical guidance
For motorized profiles, values between 80 and 90 typically provide realistic and efficient routing behavior. Values below 30 often produce routes that are not realistically driveable and are mainly useful for determining theoretical lower bounds on distance rather than for practical route planning.
Relationship to routingMode
The timePreferenceOverDistance parameter provides more control than the predefined routing modes. The parameter cannot be combined with options[routingMode]=SHORT or options[routingMode]=SHORTEST — the request will be rejected with an error. It can be used with options[routingMode]=FAST (the default) to fine-tune the fast route.
Limitations
The routing modes SHORT and SHORTEST do not consider truck routes, so the parameter vehicle[truckRoutes] will be ignored and a warning will be returned. For the profiles BICYCLE and PEDESTRIAN the routing modes are effectively the same, so options[routingMode] will be ignored and a warning will be returned.
When calculating SHORT or SHORTEST routes, it is not recommended to request alternative routes (results=ALTERNATIVE_ROUTES) or to use the options avoid and prefer turns on passenger side (options[avoid], options[preferTurnsOnPassengerSide]). The resulting routes may not be as expected.
The parameter timePreferenceOverDistance will have longer response times. When using this parameter, 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. This parameter will be ignored when a routeId is specified or when options[routingMode]=MONETARY is used.
Try it in the Short and Fast Routes code sample.