Routes Preferred API 目前仅适用于部分客户。如需了解详情,请
与销售人员联系。
ComputeCustomRoutesResponse
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
ComputeCustomRoutes 响应消息。
CustomRoute
封装根据客户指定的路线目标计算的自定义路线。CustomRoute
包含路线和路线令牌,可传递给 NavSDK 以重构自定义路线以进行精细导航。
JSON 表示法 |
{
"route": {
object (Route )
},
"token": string
} |
字段 |
route |
object (Route )
系统认为最适合输入路线目标的路线。
|
token |
string
可传递给 NavSDK 的可在 Web 环境中安全使用的 base64 编码路线令牌,使 NavSDK 能够在导航期间重构路线,并在重新路线时遵循调用 RoutesPreferred ComputeCustomRoutes 时的原始意图。客户应将此令牌视为不透明 blob。
|
FallbackInfo
封装 ComputeCustomRoutes
的后备信息。ComputeCustomRoutes
会执行两种类型的回退:
如果它无法使用客户请求的 routingPreference
计算路线,则会回退到其他路由模式。在这种情况下,fallback_routing_mode
和 routing_mode_fallback_reason
用于传达所使用的后备路由模式以及回退的原因。
如果它无法为客户指定的路线目标计算出“最佳”路线,则可能会回退到其他目标。fallback_route_objective
用于传达回退路线目标。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\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. |"]]