TrafficModel
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
In diesem Feld wird eine der folgenden Annahmen angegeben, die bei der Berechnung der Reisezeit unter Berücksichtigung der Verkehrsbedingungen verwendet werden sollen (siehe Enums unten). Je nach ausgewählter Enumeration variiert das Feld duration
der TrafficModel-Antwort. Der Wert enthält die voraussichtliche Reisezeit zum Zielort im Verkehr, basierend auf bisherigen Durchschnittswerten. TrafficModel
ist nur für Anfragen verfügbar, bei denen RoutingPreference
auf TRAFFIC_AWARE_OPTIMAL
und RouteTravelMode
auf DRIVE
gesetzt ist.
Enums |
TRAFFIC_MODEL_UNSPECIFIED |
Nicht verwendet Wenn angegeben, wird standardmäßig BEST_GUESS verwendet. |
BEST_GUESS |
Gibt an, dass die zurückgegebene duration die beste Schätzung der Reisezeit sein sollte. Dazu werden Verlaufs- und Echtzeitdaten zur Verkehrslage herangezogen. Die aktuelle Verkehrslage wird umso stärker gewichtet, je näher die departureTime rückt. |
PESSIMISTIC |
Gibt an, dass die zurückgegebene Dauer an den meisten Tagen länger als die tatsächliche Reisezeit sein sollte. An Tagen mit besonders schlechter Verkehrslage kann dieser Wert jedoch überschritten werden. |
OPTIMISTIC |
Gibt an, dass die zurückgegebene Dauer an den meisten Tagen kürzer als die tatsächliche Reisezeit sein dürfte. An Tagen mit besonders guter Verkehrslage kann dieser Wert jedoch unterschritten werden. |
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-08-31 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-08-31 (UTC)."],[[["\u003cp\u003eThe \u003ccode\u003eduration\u003c/code\u003e field provides estimated travel time influenced by the \u003ccode\u003etraffic_model\u003c/code\u003e setting.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003etraffic_model\u003c/code\u003e options include \u003ccode\u003eBEST_GUESS\u003c/code\u003e (default), \u003ccode\u003ePESSIMISTIC\u003c/code\u003e, and \u003ccode\u003eOPTIMISTIC\u003c/code\u003e, impacting travel time predictions.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBEST_GUESS\u003c/code\u003e considers historical and live traffic data for travel time estimation, with live traffic having more impact closer to departure.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ePESSIMISTIC\u003c/code\u003e and \u003ccode\u003eOPTIMISTIC\u003c/code\u003e offer durations longer and shorter than actual travel times on most days, respectively, accounting for traffic variations.\u003c/p\u003e\n"]]],["The core content outlines how to specify traffic-based time calculations, impacting the `duration` field. The `TRAFFIC_MODEL_UNSPECIFIED` defaults to `BEST_GUESS`, which uses historical and live data to estimate travel time. `PESSIMISTIC` calculates a longer travel time, likely exceeded only in severe conditions. Conversely, `OPTIMISTIC` calculates a shorter time, potentially beaten during favorable conditions. These options modify the estimated duration by factoring in historical traffic data and real-time conditions.\n"],null,["# TrafficModel\n\nSpecifies the assumptions to use when calculating time in traffic. This setting affects the value returned in the `duration` field in the response, which contains the predicted time in traffic based on historical averages.\n\n| Enums ||\n|-----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `TRAFFIC_MODEL_UNSPECIFIED` | Unused. If specified, will default to `BEST_GUESS`. |\n| `BEST_GUESS` | Indicates that the returned `duration` should be the best estimate of travel time given what is known about both historical traffic conditions and live traffic. Live traffic becomes more important the closer the `departureTime` is to now. |\n| `PESSIMISTIC` | Indicates that the returned duration should be longer than the actual travel time on most days, though occasional days with particularly bad traffic conditions may exceed this value. |\n| `OPTIMISTIC` | Indicates that the returned duration should be shorter than the actual travel time on most days, though occasional days with particularly good traffic conditions may be faster than this value. |"]]