RoutingPreference
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
枚举 |
ROUTING_PREFERENCE_UNSPECIFIED |
未指定任何路由偏好设置。默认为 TRAFFIC_UNAWARE 。 |
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-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\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 considering real-time traffic, suitable when traffic is irrelevant.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTRAFFIC_AWARE\u003c/code\u003e balances speed and accuracy by incorporating live traffic data with some optimizations for reduced latency.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTRAFFIC_AWARE_OPTIMAL\u003c/code\u003e prioritizes accuracy, calculating routes based on real-time traffic for the most precise ETAs, but may have higher latency.\u003c/p\u003e\n"],["\u003cp\u003eThe default setting is \u003ccode\u003eTRAFFIC_UNAWARE\u003c/code\u003e if no routing preference is specified using \u003ccode\u003eROUTING_PREFERENCE_UNSPECIFIED\u003c/code\u003e.\u003c/p\u003e\n"]]],["The document defines four routing preference values: `ROUTING_PREFERENCE_UNSPECIFIED` (defaulting to `TRAFFIC_UNAWARE`), `TRAFFIC_UNAWARE` (ignores live traffic, offering lowest latency and relying on average conditions), `TRAFFIC_AWARE` (considers live traffic with some latency optimizations), and `TRAFFIC_AWARE_OPTIMAL` (considers live traffic without optimizations, resulting in highest latency). When choosing routes with the drive or two-wheeler travel mode, only average time-independent conditions are considered, with possible inclusions of closed roads.\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_UNAWARE`. |\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`](/maps/documentation/routes/reference/rest/v2/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 live 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 live traffic conditions into consideration, without applying most performance optimizations. Using this value produces the highest latency. |"]]