RoutingSummary
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
La duración y la distancia desde el origen de planificación de ruta hasta un lugar en la respuesta, y un segundo tramo desde ese lugar hasta el destino, si se solicita Nota: Agregar routingSummaries
en la máscara de campo sin incluir el parámetro routingParameters.origin
o el parámetro searchAlongRouteParameters.polyline.encodedPolyline
en la solicitud causa un error.
Representación JSON |
{
"legs": [
{
object (Leg )
}
],
"directionsUri": string
} |
Campos |
legs[] |
object (Leg )
Las etapas del viaje Cuando calculas la duración y la distancia del viaje desde un origen establecido, legs contiene un solo tramo que contiene la duración y la distancia del origen al destino. Cuando realizas una búsqueda a lo largo de una ruta, legs contiene dos tramos: uno del origen al lugar y otro del lugar al destino.
|
directionsUri |
string
Es un vínculo para mostrar instrucciones sobre cómo llegar en Google Maps con los puntos de referencia del resumen de ruta determinado. No se garantiza que la ruta que genera este vínculo sea la misma que la que se usa para generar el resumen de enrutamiento. El vínculo usa la información proporcionada en la solicitud, desde campos como routingParameters y searchAlongRouteParameters , cuando corresponda, para generar el vínculo de instrucciones sobre cómo llegar.
|
Pierna
Un tramo es una sola parte de un viaje de una ubicación a otra.
Representación JSON |
{
"duration": string,
"distanceMeters": integer
} |
Campos |
duration |
string (Duration format)
Es el tiempo que se tarda en completar este tramo del viaje. Una duración en segundos con hasta nueve dígitos decimales, que terminan en “s ”. Ejemplo: "3.5s" .
|
distanceMeters |
integer
Es la distancia de este tramo del viaje.
|
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-08-31 (UTC)
[null,null,["Última actualización: 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. |"]]