翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
turn-by-turn方向でルートを検索する方法
CalculateRoutes API は、送信元と送信先の間の最適なルートと、ドライバーの休止に最適な機会を見つけるのに役立ちます。自動車、トラック、歩行者、スクーターなどの移動モードをサポートしています。また、オリジンと宛先を含む最大 25 のウェイポイント (ストップオーバー) もサポートしますが、制約はわずかです。
潜在的なユースケース
-
ナビゲーションモバイルアプリを作成する: API を使用してturn-by-turnのナビゲーション手順を取得します。
-
ウェブプラットフォームに指示を表示する: ナビゲーションに役立つウェブアプリケーションの詳細なルートガイダンスを表示します。
例
- 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"
送信元と送信先のルートを検索する
道路スパンの速度制限を見つける