受け取り場所や配達場所で U ターンを使わない
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
デフォルトでは、車両は任意の方向から集荷場所または配達場所に到着し、任意の方向に出発できます。場合によっては、車両が訪問場所で U ターンを余儀なくされることがあります。車両のサイズ、場所の交通標識、通常の交通状況によっては、U ターンが困難または不可能になることがあります。
特定の集荷場所または配達場所で、車両が到着から出発までの間に方向を変えないようにするには、この場所の avoid_u_turns
を true に設定します。この設定では、車両は同じ向きで目的地に到着し、出発するため、U ターンを回避できます。双方向道路では、ソルバーは両方向を考慮し、経路の最適化の一部としていずれかを選択します。
side_of_road
を true に設定して、車両がウェイポイントに最も近い道路の側で到着して出発するルートを取得することもできます。この場合、車両は到着から出発までの間に進行方向を変更しません。side_of_road
と avoid_u_turns
の両方を true に設定して、同じ結果を得ることもできます。詳しくは、他の機能との相互作用をご覧ください。
実際には、道路を安全に横断して経由地に到達できる場合に avoid_u_turns
を使用する必要があります。横断が推奨されない場合や横断できない場合は、side_of_road
を使用します。
例: avoid_u_turns
を使用して OptimizeTours
リクエストを行う
OptimizeTours
リクエストは、REST または gRPC のいずれかを使用して行うことができます。
リクエストを行う前に、次のパラメータを環境に適した値に置き換えます。
リクエストが完了すると、レスポンス メッセージが届きます。
他の機能との連携
avoid_u_turns
は side_of_road = true
と併用できます。この場合、U ターンは回避されますが、ソルバーは、side_of_road = true
のみを設定した場合と同様に、車両が経由地と同じ側の道路を走行するルートを選択します。
- 特定の訪問リクエストの
avoid_u_turns = true
の場合、対応するレスポンスの ShipmentRoute.Visit
には injected_solution_location_token
フィールドが設定されます。値の正確な意味は実装の詳細ですが、ソルバーが選択した道路の側に関する情報がエンコードされます。
- 入力リクエストの一部として
ShipmentRoute.Visit
を使用する場合、その ShipmentRoute.Visit
が avoid_u_turns = true
を含む VisitRequest
に対応している場合は、ShipmentRoute.Visit
に、ソルバーによって以前に返された injected_solution_location_token
が含まれている必要があります。
制限事項
U ターン回避はベスト エフォートです。状況によっては、ルートに U ターンが含まれることがあります。
avoid_u_turns
は、side_of_road
をサポートする移動手段でのみ機能します。特に、WALKING
の移動手段ではサポートされていません。
avoid_u_turns
は、到着地と出発地が異なる集荷と配達には使用できません。
- 集荷または配達が袋小路で行われる場合は、U ターンして道路から出る必要があります。
- この機能の目的は、乗車場所と配達場所での U ターンを回避することです。経由地間の U ターンは回避されません。
- 別の道路への急な方向転換は U ターンとは見なされず、通常は回避されません。
この機能の開発中は、追加の制限事項があります。この機能の進化に伴い、これらの制限は解除される予定です。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-04 UTC。
[null,null,["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eVehicles typically arrive and depart from locations in any direction, potentially requiring u-turns.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eavoid_u_turns\u003c/code\u003e setting prevents vehicles from changing direction at a pickup or delivery location, ensuring arrival and departure with the same heading.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eside_of_road\u003c/code\u003e setting ensures vehicles arrive and leave on the side of the road closest to the waypoint, also avoiding changes in heading.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eavoid_u_turns\u003c/code\u003e and \u003ccode\u003eside_of_road\u003c/code\u003e can be used together to prevent u-turns while also maintaining the vehicle's position on the correct side of the road.\u003c/p\u003e\n"],["\u003cp\u003eU-turn avoidance is not supported in all travel modes, such as \u003ccode\u003eWALKING\u003c/code\u003e mode, and is also not supported when the arrival and departure locations for a delivery or pickup differ.\u003c/p\u003e\n"]]],[],null,["\u003cbr /\u003e\n\n| This product or feature is Experimental (pre-GA). Pre-GA products and features might have limited support, and changes to pre-GA products and features might not be compatible with other pre-GA versions. Pre-GA Offerings are covered by the [Google\n| Maps Platform Service Specific Terms](https://cloud.google.com/maps-platform/terms/maps-service-terms). For more information, see the [launch stage descriptions](/maps/launch-stages).\n\n\u003cbr /\u003e\n\nBy default, vehicles can arrive at a pickup or a delivery location from any\ndirection, and then leave in any direction. In some cases, this forces\nthe vehicle to make a u-turn at the visit location, which may be difficult or\nimpossible because of vehicle size, traffic signs at the location, or usual\ntraffic conditions.\n\nTo prevent vehicles from changing direction between the arrival and departure\nfor a given pickup or delivery location, you can set [`avoid_u_turns`](/maps/tt/route-optimization/experimental/u-turn-avoidance/reference/rest/v1/ShipmentModel#VisitRequest.FIELDS.avoid_u_turns) to\ntrue for this location. Under this setting, the vehicle will arrive and leave\nthe location with the same heading, thus avoiding the u-turn. On two-way roads\nthe solver will consider both directions and choose one as part of the route\noptimization.\n\nYou can also set [`side_of_road`](/maps/tt/route-optimization/experimental/u-turn-avoidance/reference/rest/v1/projects/optimizeTours#google.maps.routeoptimization.v1.Waypoint.FIELDS.bool.google.maps.routeoptimization.v1.Waypoint.side_of_road) to true to obtain a route where the vehicle\narrives and leaves on the side of the road closest to the waypoint. In this\ncase, the vehicle also does not change heading between the arrival and the\ndeparture. It is possible to set both `side_of_road` and `avoid_u_turns` to true\nto achieve the same result. For details, see [Interaction with other\nfeatures](#interaction_with_other_features).\n\nIn practice, `avoid_u_turns` should be used when it is safe to cross the road to\nget to the waypoint. Use `side_of_road` when crossing is discouraged or not\npossible.\n\nExample: Make an `OptimizeTours` request with `avoid_u_turns`\n\n`OptimizeTours` requests can be made using either [REST](/maps/tt/route-optimization/experimental/u-turn-avoidance/reference/rest/v1/projects/optimizeTours) or [gRPC](/maps/tt/route-optimization/experimental/u-turn-avoidance/reference/rpc/google.maps.routeoptimization.v1#routeoptimization).\n\nBefore making a request, replace the following parameters with values\nappropriate for your environment:\n\n- Ensure you have [Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc) configured as described in [Use OAuth](/maps/documentation/route-optimization/oauth-token).\n- Set \u003cvar label=\"project_number\" translate=\"no\"\u003ePROJECT_NUMBER_OR_ID\u003c/var\u003e to your Cloud\n project number or ID.\n\n The following command sends an `OptimizeTours` request to the Route\n Optimization API and receives a response synchronously. \n\n ```scdoc\n curl -X POST 'https://routeoptimization.googleapis.com/v1/projects/PROJECT_NUMBER_OR_ID:optimizeTours' \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $(gcloud auth application-default print-access-token)\" \\\n --data @- \u003c\u003cEOM\n {\n \"model\": {\n \"shipments\": [\n {\n \"pickups\": [\n {\n \"arrivalLocation\": {\n \"latitude\": 37.42506261000996,\n \"longitude\": -122.09535511930135\n },\n \"avoidUTurns\": true\n }\n ],\n \"deliveries\": [\n {\n \"arrivalLocation\": {\n \"latitude\": 37.42421503206021,\n \"longitude\": -122.09526063135228\n },\n \"avoidUTurns\": true\n }\n ]\n }\n ],\n \"vehicles\": [\n {\n \"travelMode\": \"DRIVING\",\n \"costPerKilometer\": 1.0\n }\n ],\n }\n }\n EOM\n ```\n | **Note:** this example uses the `--data @-` to read a request from standard input. Use `--data @`\u003cvar label=\"curl_filename\" translate=\"no\"\u003eFilename\u003c/var\u003e to read from a file.\n\nOnce the request completes, you'll receive a response message.\n\nInteraction with other features\n\n- `avoid_u_turns` can be used together with `side_of_road = true`. In this case, u-turns are avoided, but the solver selects a route that the vehicle is on the same side of the road as the waypoint, similar to setting `side_of_road = true` alone.\n- When `avoid_u_turns = true` for a certain visit request, then the `ShipmentRoute.Visit` in the corresponding response has the field `injected_solution_location_token` set. The precise meaning of its value is an implementation detail, but it encodes the information about the side of the road picked by the solver.\n- When you use a `ShipmentRoute.Visit` as part of the input request, if that `ShipmentRoute.Visit` corresponds to a `VisitRequest` in which `avoid_u_turns = true`, then `ShipmentRoute.Visit` must contain an `injected_solution_location_token` previously returned by the solver.\n\nLimitations\n\nU-turn avoidance is best effort. In certain situations, the route may still\ncontain u-turns:\n\n- `avoid_u_turns` works only with travel modes that support [`side_of_road`](/maps/tt/route-optimization/experimental/u-turn-avoidance/reference/rest/v1/projects/optimizeTours#google.maps.routeoptimization.v1.Waypoint.FIELDS.bool.google.maps.routeoptimization.v1.Waypoint.side_of_road). Specifically, it is not supported for the `WALKING` travel mode.\n- `avoid_u_turns` can't be used for pickups and deliveries where the arrival and departure are not the same.\n- When a pickup or a delivery is on a dead-end road, it is necessary to make a u-turn to leave the road.\n- The aim of this feature is avoiding u-turns at pickup and delivery locations. U-turns between waypoints are not avoided.\n- Very sharp turns to a different road are not considered u-turns, and they will generally not be avoided.\n\nThere are additional limitations while this feature is under development. We\nexpect them to be lifted as the feature evolves.\n\n- `avoid_u_turns` can't be used together with [`interpret_injected_solutions_using_labels`](/maps/tt/route-optimization/experimental/u-turn-avoidance/reference/rest/v1/projects/optimizeTours#google.maps.routeoptimization.v1.OptimizeToursRequest.FIELDS.bool.google.maps.routeoptimization.v1.OptimizeToursRequest.interpret_injected_solutions_using_labels)."]]