Routes Preferred API is currently available only to select customers.
Contact sales to learn more.
ComputeCustomRoutesResponse
Stay organized with collections
Save and categorize content based on your preferences.
ComputeCustomRoutes response message.
Fields |
routes[] |
object (CustomRoute )
The ‘best’ routes for the input route objective.
|
fastestRoute |
object (CustomRoute )
The fastest reference route.
|
shortestRoute |
object (CustomRoute )
The shortest reference route.
|
fallbackInfo |
object (FallbackInfo )
Fallback info for custom routes.
|
CustomRoute
Encapsulates a custom route computed based on the route objective specified by the customer. CustomRoute
contains a route and a route token, which can be passed to NavSDK to reconstruct the custom route for turn by turn navigation.
JSON representation |
{
"route": {
object (Route )
},
"token": string
} |
Fields |
route |
object (Route )
The route considered 'best' for the input route objective.
|
token |
string
Web-safe base64 encoded route token that can be passed to NavSDK, which allows NavSDK to reconstruct the route during navigation, and in the event of rerouting honor the original intention when RoutesPreferred ComputeCustomRoutes is called. Customers should treat this token as an opaque blob.
|
FallbackInfo
Encapsulates fallback info for ComputeCustomRoutes
. ComputeCustomRoutes
performs two types of fallbacks:
If it cannot compute the route using the routingPreference
requested by the customer, it will fallback to another routing mode. In this case fallback_routing_mode
and routing_mode_fallback_reason
are used to communicate the fallback routing mode used, as well as the reason for fallback.
If it cannot compute a 'best' route for the route objective specified by the customer, it might fallback to another objective. fallback_route_objective
is used to communicate the fallback route objective.
Fields |
routingMode |
enum (FallbackRoutingMode )
Routing mode used for the response. If fallback was triggered, the mode may be different from routing preference set in the original client request.
|
routingModeReason |
enum (FallbackReason )
The reason why fallback response was used instead of the original response. This field is only populated when the fallback mode is triggered and the fallback response is returned.
|
routeObjective |
enum (FallbackRouteObjective )
The route objective used for the response. If fallback was triggered, the objective may be different from the route objective provided in the original client request.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-27 UTC."],[[["\u003cp\u003e\u003ccode\u003eComputeCustomRoutes\u003c/code\u003e response provides the 'best' routes, the fastest route, and the shortest route based on the specified route objective.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCustomRoute\u003c/code\u003e includes a route and a token for navigation using NavSDK, honoring the original route intention.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eFallbackInfo\u003c/code\u003e details any fallbacks used during route computation, potentially involving a different routing mode or route objective.\u003c/p\u003e\n"],["\u003cp\u003eThe response might utilize fallback mechanisms if the preferred routing mode or route objective cannot be satisfied, offering alternative solutions.\u003c/p\u003e\n"]]],["The document describes the `ComputeCustomRoutes` response, which includes an array of `routes`, `fastestRoute`, `shortestRoute`, and `fallbackInfo`. `CustomRoute` contains the `best` route and a token for reconstruction. `FallbackInfo` details any fallback actions: routing mode, fallback reason, and route objective. Two fallback scenarios are described: switching routing modes and using an alternate route objective when the requested options are not viable. The information in these objects are provided as JSON representations.\n"],null,["# ComputeCustomRoutesResponse\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [CustomRoute](#CustomRoute)\n - [JSON representation](#CustomRoute.SCHEMA_REPRESENTATION)\n- [FallbackInfo](#FallbackInfo)\n - [JSON representation](#FallbackInfo.SCHEMA_REPRESENTATION)\n\nComputeCustomRoutes response message.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"routes\": [ { object (/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#CustomRoute) } ], \"fastestRoute\": { object (/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#CustomRoute) }, \"shortestRoute\": { object (/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#CustomRoute) }, \"fallbackInfo\": { object (/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#FallbackInfo) } } ``` |\n\n| Fields ||\n|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `routes[]` | `object (`[CustomRoute](/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#CustomRoute)`)` The 'best' routes for the input route objective. |\n| `fastest``Route` | `object (`[CustomRoute](/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#CustomRoute)`)` The fastest reference route. |\n| `shortest``Route` | `object (`[CustomRoute](/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#CustomRoute)`)` The shortest reference route. |\n| `fallback``Info` | `object (`[FallbackInfo](/maps/documentation/routes_preferred/reference/rest/Shared.Types/ComputeCustomRoutesResponse#FallbackInfo)`)` Fallback info for custom routes. |\n\nCustomRoute\n-----------\n\nEncapsulates a custom route computed based on the route objective specified by the customer. `CustomRoute` contains a route and a route token, which can be passed to NavSDK to reconstruct the custom route for turn by turn navigation.\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"route\": { object (/maps/documentation/routes_preferred/reference/rest/Shared.Types/Route) }, \"token\": string } ``` |\n\n| Fields ||\n|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `route` | `object (`[Route](/maps/documentation/routes_preferred/reference/rest/Shared.Types/Route)`)` The route considered 'best' for the input route objective. |\n| `token` | `string` Web-safe base64 encoded route token that can be passed to NavSDK, which allows NavSDK to reconstruct the route during navigation, and in the event of rerouting honor the original intention when `RoutesPreferred` `ComputeCustomRoutes` is called. Customers should treat this token as an opaque blob. |\n\nFallbackInfo\n------------\n\nEncapsulates fallback info for `ComputeCustomRoutes`. `ComputeCustomRoutes` performs two types of fallbacks:\n\n1. If it cannot compute the route using the `routingPreference` requested by the customer, it will fallback to another routing mode. In this case `fallback_routing_mode` and `routing_mode_fallback_reason` are used to communicate the fallback routing mode used, as well as the reason for fallback.\n\n2. If it cannot compute a 'best' route for the route objective specified by the customer, it might fallback to another objective. `fallback_route_objective` is used to communicate the fallback route objective.\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"routingMode\": enum (/maps/documentation/routes_preferred/reference/rest/Shared.Types/FallbackRoutingMode), \"routingModeReason\": enum (/maps/documentation/routes_preferred/reference/rest/Shared.Types/FallbackReason), \"routeObjective\": enum (/maps/documentation/routes_preferred/reference/rest/Shared.Types/FallbackRouteObjective) } ``` |\n\n| Fields ||\n|-------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `routing``Mode` | `enum (`[FallbackRoutingMode](/maps/documentation/routes_preferred/reference/rest/Shared.Types/FallbackRoutingMode)`)` Routing mode used for the response. If fallback was triggered, the mode may be different from routing preference set in the original client request. |\n| `routing``Mode``Reason` | `enum (`[FallbackReason](/maps/documentation/routes_preferred/reference/rest/Shared.Types/FallbackReason)`)` The reason why fallback response was used instead of the original response. This field is only populated when the fallback mode is triggered and the fallback response is returned. |\n| `route``Objective` | `enum (`[FallbackRouteObjective](/maps/documentation/routes_preferred/reference/rest/Shared.Types/FallbackRouteObjective)`)` The route objective used for the response. If fallback was triggered, the objective may be different from the route objective provided in the original client request. |"]]