本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
不在 Amazon Location 中道路上的位置
使用 CalculateRoute
或 時CalculateRouteMatrix
,如果您指定不在 Amazon Location 道路上的出發點、目的地或航點位置,則會將位置移至附近的道路。
下列CalculateRoute
請求會指定不在道路上的出發位置和目的地位置:
POST /routes/v0/calculators/
ExampleCalculator
/calculate/route Content-type: application/json { "DeparturePosition": [-123.128014, 49.298472
], "DestinationPosition": [-123.134701, 49. 294315
] }
產生的回應會傳回卡在附近道路的位置:
{ "Legs": [ { "StartPosition": [
-123.12815, 49.29717
], "EndPosition": [-123.13375, 49.2926
], "Distance": 4.223, "DurationSeconds": 697, "Steps": [ { "StartPosition": [ -123.12815, 49.29717 ], "EndPosition": [ -123.12806, 49.29707 ], "Distance": 0.013, "DurationSeconds": 8 }, { "StartPosition": [ -123.12806, 49.29707 ], "EndPosition": [ -123.1288, 49.29659 ], "Distance": 0.082, "DurationSeconds": 36 }, { "StartPosition": [ -123.1288, 49.29659 ], "EndPosition": [ -123.12021, 49.29853 ], "Distance": 0.742, "DurationSeconds": 128 }, { "StartPosition": [ -123.12021, 49.29853 ], "EndPosition": [ -123.1201, 49.29959 ], "Distance": 0.131, "DurationSeconds": 26 }, { "StartPosition": [ -123.1201, 49.29959 ], "EndPosition": [ -123.13562, 49.30681 ], "Distance": 1.47, "DurationSeconds": 238 }, { "StartPosition": [ -123.13562, 49.30681 ], "EndPosition": [ -123.13693, 49.30615 ], "Distance": 0.121, "DurationSeconds": 28 }, { "StartPosition": [ -123.13693, 49.30615 ], "EndPosition": [ -123.13598, 49.29755 ], "Distance": 0.97, "DurationSeconds": 156 }, { "StartPosition": [ -123.13598, 49.29755 ], "EndPosition": [ -123.13688, 49.29717 ], "Distance": 0.085, "DurationSeconds": 15 }, { "StartPosition": [ -123.13688, 49.29717 ], "EndPosition": [ -123.13375, 49.2926 ], "Distance": 0.609, "DurationSeconds": 62 } ] } ], "Summary": { "RouteBBox": [ -123.13693, 49.2926, -123.1201, 49.30681 ], "DataSource": "Here", "Distance": 4.223, "DurationSeconds": 697, "DistanceUnit": "Kilometers" } }