הימנעות מפנייה U במיקומי האיסוף וההעברה
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
כברירת מחדל, רכבים יכולים להגיע למיקום איסוף או למיקום משלוח מכל כיוון, ואז לצאת לכל כיוון. במקרים מסוימים, הפעולה הזו גורמת לרכב לבצע פניית פרסה במיקום הביקור, וזה עלול להיות קשה או בלתי אפשרי בגלל גודל הרכב, תמרורי התנועה במיקום או תנאי התנועה הרגילים.
כדי למנוע מכלי רכב לשנות כיוון בין ההגעה לבין היציאה במיקום מסוים של איסוף או משלוח, אפשר להגדיר את avoid_u_turns
לערך true עבור המיקום הזה. בהגדרה הזו, כלי הרכב יגיע למיקום ויצא ממנו באותו כיוון, וכך לא יבצע פניית פרסה. בכבישים דו-סטריים, הפותר יתייחס לשני הכיוונים ויבחר אחד מהם כחלק מאופטימיזציית המסלול.
אפשר גם להגדיר את side_of_road
כ-true כדי לקבל מסלול שבו הרכב מגיע לצד הכביש הקרוב ביותר לנקודת הדרך ויוצא ממנו. במקרה הזה, הרכב גם לא משנה את הכיוון בין ההגעה ליציאה. אפשר להגדיר גם את side_of_road
וגם את avoid_u_turns
לערך true כדי להשיג את אותה תוצאה. לפרטים נוספים, אפשר לעיין במאמר בנושא אינטראקציה עם תכונות אחרות.
בפועל, צריך להשתמש בavoid_u_turns
רק כשבטוח לחצות את הכביש כדי להגיע לנקודת הדרך. מומלץ להשתמש בside_of_road
כשלא מומלץ לחצות או כשאי אפשר לחצות.
דוגמה: שליחת בקשה OptimizeTours
באמצעות avoid_u_turns
אפשר לשלוח בקשות OptimizeTours
באמצעות REST או gRPC.
לפני ששולחים בקשה, מחליפים את הפרמטרים הבאים בערכים שמתאימים לסביבה שלכם:
בסיום הטיפול בבקשה, תקבלו הודעת תשובה.
אינטראקציה עם תכונות אחרות
- אפשר להשתמש ב-
avoid_u_turns
יחד עם side_of_road = true
. במקרה הזה, המערכת תמנע פניות פרסה, אבל פותר הבעיות יבחר מסלול שבו הרכב נמצא באותו צד של הכביש כמו נקודת הציון, בדומה להגדרה של side_of_road = true
בלבד.
- אם הערך של
avoid_u_turns = true
בבקשה מסוימת לביקור הוא ShipmentRoute.Visit
, השדה injected_solution_location_token
מוגדר בתשובה המתאימה. המשמעות המדויקת של הערך היא פרט הטמעה, אבל הוא מקודד את המידע על הצד של הכביש שנבחר על ידי הפותר.
- כשמשתמשים ב-
ShipmentRoute.Visit
כחלק מבקשת הקלט, אם ShipmentRoute.Visit
מתאים ל-VisitRequest
שבו avoid_u_turns = true
, אז ShipmentRoute.Visit
חייב להכיל injected_solution_location_token
שהוחזר קודם על ידי הפותר.
מגבלות
מניעת פניות פרסה היא מאמץ מיטבי. במצבים מסוימים, יכול להיות שהמסלול עדיין יכלול פניות פרסה:
-
avoid_u_turns
פועל רק עם אמצעי תחבורה שתומכים ב-side_of_road
.
באופן ספציפי, הוא לא נתמך במצב הנסיעה WALKING
.
- אי אפשר להשתמש ב-
avoid_u_turns
לאיסוף ולמשלוח של מוצרים אם נקודת ההגעה ונקודת היציאה שונות.
- כשנקודת איסוף או מסירה נמצאת בכביש ללא מוצא, צריך לבצע פניית פרסה כדי לצאת מהכביש.
- המטרה של התכונה הזו היא למנוע פניות פרסה בנקודות איסוף ומסירה.
המערכת לא מונעת פניות פרסה בין נקודות ציון.
- פניות חדות מאוד לכביש אחר לא נחשבות לפרסה, ובדרך כלל המערכת לא תנסה להימנע מהן.
בזמן שהתכונה הזו נמצאת בפיתוח, יש מגבלות נוספות. אנחנו
מצפים שהמגבלות יוסרו ככל שהתכונה תתפתח.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-09-03 (שעון UTC).
[null,null,["עדכון אחרון: 2025-09-03 (שעון 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)."]]