RoutingSummary
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
ルーティングの出発地からレスポンスの場所までの所要時間と距離、およびその場所から目的地までの 2 番目の区間(リクエストされた場合)。注: リクエストに routingParameters.origin
パラメータまたは searchAlongRouteParameters.polyline.encodedPolyline
パラメータを含めずにフィールドマスクに routingSummaries
を追加すると、エラーが発生します。
JSON 表現 |
{
"legs": [
{
object (Leg )
}
],
"directionsUri": string
} |
フィールド |
legs[] |
object (Leg )
旅行の区間。 設定した出発地から移動時間と距離を計算する場合、legs には、出発地から目的地までの所要時間と距離を含む単一の区間が含まれます。経路沿いで検索を行うと、legs には 2 つの区間が含まれます。1 つは出発地から場所への区間、もう 1 つは場所から目的地への区間です。
|
directionsUri |
string
指定されたルート概要のウェイポイントを使用して Google マップで経路を表示するためのリンク。このリンクで生成されたルートが、ルーティングの概要の生成に使用されたルートと同じであるとは限りません。このリンクは、リクエストで指定された情報(routingParameters や searchAlongRouteParameters など)を使用して、ルート案内リンクを生成します。
|
脚
区間は、ある場所から別の場所へのルートの 1 つの部分です。
JSON 表現 |
{
"duration": string,
"distanceMeters": integer
} |
フィールド |
duration |
string (Duration format)
この区間の所要時間。 s で終わる小数 9 桁までの秒単位の期間。例: "3.5s" 。
|
distanceMeters |
integer
この旅行区間の距離。
|
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-31 UTC。
[null,null,["最終更新日 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. |"]]