ターンバイターン方式でルートを見つける方法 - Amazon Location Service

ターンバイターン方式でルートを見つける方法

CalculateRoutes API は、出発地と目的地間の最適なルートと、ドライバーの休憩に最適なタイミングを見つけるのに役立ちます。自動車、トラック、歩行、スクーターなどの移動モードをサポートしています。また、出発地と目的地を含む最大 25 のウェイポイント (ストップオーバー) にも対応していますが、若干の制約があります。

想定されるユースケース

  • ナビゲーションモバイルアプリを作成する: API を使用してターンバイターン方式のナビゲーションを取得します。

  • ウェブプラットフォームに道順を表示する: ナビゲーションに役立つウェブアプリケーションの詳細なルートガイダンスを表示します。

Sample request
{ "Origin": [ -123.118105, 49.282423 ], "Destination": [ -123.020098, 49.232872 ], "TravelStepType": "TurnByTurn", "TravelMode": "Car" }
Sample response
{ "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes": [ { "Legs": [ { "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { "Arrival": { "Place": { "Position": [-123.0203051, 49.2328499] } }, "Departure": { "Place": { "Position": [-123.1180883, 49.2824349] } }, "TravelSteps": [ { "Distance": 1288, "Duration": 102, "Type": "Depart", "NextRoad": { "RoadName": "W Georgia St", "RouteNumber": "HWY-1A" } }, { "Distance": 262, "Duration": 24, "Type": "Keep", "NextRoad": { "RoadName": "Main St", "RouteNumber": "HWY-1A" } }, { "Distance": 1356, "Duration": 134, "Type": "Turn", "NextRoad": { "RoadName": "Main St", "RouteNumber": "HWY-1A" } }, { "Distance": 7092, "Duration": 568, "Type": "Keep", "NextRoad": { "RoadName": "Kingsway", "RouteNumber": "HWY-1A" } }, { "Distance": 65, "Duration": 26, "Type": "Turn" }, { "Distance": 0, "Duration": 0, "Type": "Arrive" } ] } } ] } ] }
cURL
curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/routes?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origin": [ -123.118105, 49.282423 ], "Destination": [ -123.020098, 49.232872 ], "TravelStepType": "TurnByTurn", "TravelMode": "Car" }'
AWS CLI
aws geo-routes calculate-routes --key ${YourKey} \ --origin -123.118105 49.282423 \ --destination -123.020098 49.232872 \ --travel-step-type "TurnByTurn" \ --travel-mode "Car"