RoutingPreference
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Zestaw wartości określających czynniki, które należy brać pod uwagę przy obliczaniu trasy.
Wartości w polu enum |
ROUTING_PREFERENCE_UNSPECIFIED |
Nie określono preferencji dotyczących routingu. Wartość domyślna to TRAFFIC_UNAWARE . |
TRAFFIC_UNAWARE |
Oblicza trasy bez uwzględniania bieżących warunków drogowych. Odpowiednie, gdy warunki na drodze nie mają znaczenia lub nie mają zastosowania. Użycie tej wartości daje najniższy czas oczekiwania. Uwaga: w przypadku aplikacji RouteTravelMode DRIVE i TWO_WHEELER wybrana trasa i czas jej trwania zależą od sieci drogowej i średniej wartości natężenia ruchu niezależnego od czasu, a nie bieżących warunków na drodze. Dlatego też trasy mogą obejmować drogi, które są tymczasowo zamknięte. Wyniki dla danego żądania mogą się z czasem zmieniać w wyniku zmian w sieci dróg, aktualnych warunków średniej ruchu oraz rozproszonego charakteru usługi. Wyniki mogą się też zmieniać w dowolnej chwili i z częstotliwością niemal identycznych tras. |
TRAFFIC_AWARE |
Oblicza trasy z uwzględnieniem bieżących warunków drogowych. W przeciwieństwie do TRAFFIC_AWARE_OPTIMAL niektóre optymalizacje mają zastosowanie w celu znacznego skrócenia czasu oczekiwania. |
TRAFFIC_AWARE_OPTIMAL |
Oblicza trasy z uwzględnieniem bieżących warunków drogowych, bez zastosowania większości optymalizacji skuteczności. Użycie tej wartości powoduje najdłuższe opóźnienie. |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-08-31 UTC.
[null,null,["Ostatnia aktualizacja: 2025-08-31 UTC."],[[["\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. |"]]