RoutingSummary
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Dauer und Entfernung vom Startpunkt der Route zu einem Ort in der Antwort und, falls angefordert, ein zweiter Abschnitt von diesem Ort zum Ziel. Hinweis:Wenn Sie routingSummaries
in die Feldmaske einfügen, ohne den Parameter routingParameters.origin
oder searchAlongRouteParameters.polyline.encodedPolyline
in die Anfrage aufzunehmen, führt dies zu einem Fehler.
JSON-Darstellung |
{
"legs": [
{
object (Leg )
}
],
"directionsUri": string
} |
Felder |
legs[] |
object (Leg )
Die einzelnen Etappen der Fahrt. Wenn Sie die Fahrzeit und Entfernung von einem festgelegten Startort berechnen, enthält legs einen einzelnen Abschnitt mit der Dauer und Entfernung vom Start- zum Zielort. Wenn Sie eine Suche entlang einer Route durchführen, enthält legs zwei Abschnitte: einen vom Start- zum Zielort und einen vom Zielort zum Ziel.
|
directionsUri |
string
Ein Link, über den eine Wegbeschreibung in Google Maps mit den Wegpunkten aus der angegebenen Routenübersicht angezeigt wird. Es kann nicht garantiert werden, dass die Route, die über diesen Link generiert wird, mit der Route übereinstimmt, die zum Generieren der Routingübersicht verwendet wurde. Der Link verwendet Informationen aus der Anfrage, z. B. aus den Feldern routingParameters und searchAlongRouteParameters , um den Link zu den Wegbeschreibungen zu generieren.
|
Bein
Ein Abschnitt ist ein einzelner Teil einer Fahrt von einem Ort zu einem anderen.
JSON-Darstellung |
{
"duration": string,
"distanceMeters": integer
} |
Felder |
duration |
string (Duration format)
Die Zeit, die für diesen Teil der Fahrt benötigt wird. Die Dauer in Sekunden mit bis zu neun Nachkommastellen und am Ende mit "s ". Beispiel: "3.5s" .
|
distanceMeters |
integer
Die Entfernung dieses Abschnitts der Fahrt.
|
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\u003eRouting Summary provides the duration and distance between an origin and a destination, or between an origin, a place, and a destination when searching along a route.\u003c/p\u003e\n"],["\u003cp\u003eIt includes a directions URI for viewing the route on Google Maps.\u003c/p\u003e\n"],["\u003cp\u003eA Leg within the Routing Summary represents a portion of the journey, containing duration and distance in meters.\u003c/p\u003e\n"],["\u003cp\u003eWhen searching along a route, the \u003ccode\u003elegs\u003c/code\u003e field will contain two legs: one from the origin to the place and another from the place to the destination.\u003c/p\u003e\n"]]],["The content details routing summary data, including journey legs and a directions link. A routing summary contains \"legs,\" with each leg representing a portion of a journey. Each `leg` provides `duration` (time to complete the leg) and `distanceMeters`. The `directionsUri` field provides a Google Maps link for directions. When searching along a route, the summary includes two legs, otherwise it only includes one. Including `routingSummaries` in a request requires including an `origin` or `encodedPolyline` parameter.\n"],null,["# RoutingSummary\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [Leg](#Leg)\n - [JSON representation](#Leg.SCHEMA_REPRESENTATION)\n\nThe duration and distance from the routing origin to a place in the response, and a second leg from that place to the destination, if requested. **Note:** Adding `routingSummaries` in the field mask without also including either the `routingParameters.origin` parameter or the `searchAlongRouteParameters.polyline.encodedPolyline` parameter in the request causes an error.\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"legs\": [ { object (/maps/documentation/places/web-service/reference/rest/v1/RoutingSummary#Leg) } ], \"directionsUri\": string } ``` |\n\n| Fields ||\n|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `legs[]` | `object (`[Leg](/maps/documentation/places/web-service/reference/rest/v1/RoutingSummary#Leg)`)` The legs of the trip. When you calculate travel duration and distance from a set origin, `legs` contains a single leg containing the duration and distance from the origin to the destination. When you do a search along route, `legs` contains two legs: one from the origin to place, and one from the place to the destination. |\n| `directionsUri` | `string` A link to show directions on Google Maps using the waypoints from the given routing summary. The route generated by this link is not guaranteed to be the same as the route used to generate the routing summary. The link uses information provided in the request, from fields including `routingParameters` and `searchAlongRouteParameters` when applicable, to generate the directions link. |\n\nLeg\n---\n\nA leg is a single portion of a journey from one location to another.\n\n| JSON representation |\n|-----------------------------------------------------------|\n| ``` { \"duration\": string, \"distanceMeters\": integer } ``` |\n\n| Fields ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `duration` | `string (`[Duration](https://protobuf.dev/reference/protobuf/google.protobuf/#duration)` format)` The time it takes to complete this leg of the trip. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `\"3.5s\"`. |\n| `distanceMeters` | `integer` The distance of this leg of the trip. |"]]