Routes Preferred API 目前仅适用于部分客户。如需了解详情,请
与销售人员联系。
RoutingPreference
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
枚举 |
ROUTING_PREFERENCE_UNSPECIFIED |
未指定路由偏好设置。默认为 TRAFFIC_AWARE 。 |
TRAFFIC_UNAWARE |
计算路线时不考虑实时路况。在路况不重要或不适用时使用。使用此值可产生最短的延迟时间。注意:对于 RouteTravelMode DRIVE 和 TWO_WHEELER,系统会根据道路网和与时间无关的平均路况信息而非当前路况信息来选择路线和时长。因此,路线可能包括暂时关闭的道路。受道路网变化、平均路况信息更新以及服务的分布式性质的影响,给定请求的结果可能会随时间的推移而发生变化。此外,在时间或频率不受限制的情况下,即使两条路线几乎相同,结果还是有可能不同。 |
TRAFFIC_AWARE |
计算路线时会考虑路况信息。与 TRAFFIC_AWARE_OPTIMAL 相比,它会应用一些优化来显著缩短延迟时间。 |
TRAFFIC_AWARE_OPTIMAL |
计算路线时会考虑交通状况,但不会应用大多数性能优化。使用此值会产生最长的延迟时间。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):2025-08-29。"],[[["\u003cp\u003eRouting preferences determine how routes are calculated, considering factors like traffic conditions.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTRAFFIC_UNAWARE\u003c/code\u003e provides the fastest routes without traffic considerations, while potentially including closed roads.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTRAFFIC_AWARE\u003c/code\u003e balances speed and accuracy by considering traffic, with some optimizations for latency.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTRAFFIC_AWARE_OPTIMAL\u003c/code\u003e prioritizes accuracy over speed, using live traffic data for the most precise routes but with higher latency.\u003c/p\u003e\n"],["\u003cp\u003eDefault routing preference is \u003ccode\u003eTRAFFIC_AWARE\u003c/code\u003e if none is specified.\u003c/p\u003e\n"]]],["The provided information details routing preferences for route calculation. `TRAFFIC_UNAWARE` computes routes disregarding live traffic, prioritizing low latency based on road network and average traffic conditions. `TRAFFIC_AWARE` considers traffic but optimizes for lower latency. `TRAFFIC_AWARE_OPTIMAL` prioritizes traffic considerations without performance optimizations, resulting in higher latency. If no preference is specified (`ROUTING_PREFERENCE_UNSPECIFIED`), the system defaults to `TRAFFIC_AWARE`.\n"],null,["# RoutingPreference\n\nA set of values that specify factors to take into consideration when calculating the route.\n\n| Enums ||\n|----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `ROUTING_PREFERENCE_UNSPECIFIED` | No routing preference specified. Default to `TRAFFIC_AWARE`. |\n| `TRAFFIC_UNAWARE` | Computes routes without taking live traffic conditions into consideration. Suitable when traffic conditions don't matter or are not applicable. Using this value produces the lowest latency. Note: For `RouteTravelMode` DRIVE and TWO_WHEELER, the route and duration chosen are based on road network and average time-independent traffic conditions, not current road conditions. Consequently, routes may include roads that are temporarily closed. Results for a given request may vary over time due to changes in the road network, updated average traffic conditions, and the distributed nature of the service. Results may also vary between nearly-equivalent routes at any time or frequency. |\n| `TRAFFIC_AWARE` | Calculates routes taking traffic conditions into consideration. In contrast to `TRAFFIC_AWARE_OPTIMAL`, some optimizations are applied to significantly reduce latency. |\n| `TRAFFIC_AWARE_OPTIMAL` | Calculates the routes taking traffic conditions into consideration, without applying most performance optimizations. Using this value produces the highest latency. |"]]