送信元と送信先のルートを検索する方法 - Amazon Location Service

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

送信元と送信先のルートを検索する方法

CalculateRoutes API は、送信元と送信先の間の最適なルートと、ドライバーの休止に最適な機会を見つけるのに役立ちます。トラック、歩行者、車、スクーターなどの移動モードをサポートしています。また、いくつかの制約があるオリジンと宛先を含めて、最大 25 のウェイポイント (ストップオーバー) もサポートしています。

潜在的なユースケース

  • point-to-pointルートの検索: さまざまな移動モードと追加オプションに基づいて、2 つのロケーション間の最適なルートを決定します。

Sample request
{ "Origin": [ -123.118105, 49.282423 ], "Destination": [ -123.020098, 49.232872 ] }
Sample response
{ "LegGeometryFormat": "FlexiblePolyline", "Notices": [], "Routes": [ { "Legs": [ { "Geometry": { "Polyline": "Redacted" }, "TravelMode": "Car", "Type": "Vehicle", "VehicleLegDetails": { "AfterTravelSteps": [], "Arrival": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.020098, 49.232872 ], "Position": [ -123.0203051, 49.2328499 ] } }, "Departure": { "Place": { "ChargingStation": false, "OriginalPosition": [ -123.1181051, 49.282423 ], "Position": [ -123.1180883, 49.2824349 ] } }, "TravelSteps": [ { "Distance": 1288, "Duration": 102, "Type": "Depart" }, { "Distance": 262, "Duration": 24, "Type": "Ramp" }, { "Distance": 1356, "Duration": 134, "Type": "Turn" }, { "Distance": 7092, "Duration": 568, "Type": "Keep" }, { "Distance": 65, "Duration": 26, "Type": "Turn" }, { "Distance": 50, "Duration": 18, "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 ] }'
AWS CLI
aws geo-routes calculate-routes --key ${YourKey} \ --origin -123.118105 49.282423 \ --destination -123.020098 49.232872