회피하여 라우팅 매트릭스를 계산하는 방법 - Amazon Location Service

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

회피하여 라우팅 매트릭스를 계산하는 방법

CalculateRouteMatrix API는 경로를 계산하고 지정된 목록의 각 오리진에서 각 대상까지의 이동 시간과 거리를 반환합니다. API를 사용하여 특정 영역 또는 도로 특성에 대한 회피 옵션을 설정하여 경로가 지정된 영역 또는 조건을 피하도록 할 수 있습니다. 대체 경로가 불가능한 경우 회피 기본 설정을 우회할 수 있습니다.

잠재적 사용 사례

  • 경로 계획 및 최적화: 특정 영역 또는 도로 특성을 피하면서 최적화된 이동 경로가 필요한 소프트웨어의 입력으로 경로 매트릭스를 사용합니다.

예시

Sample request
{ "Origins": [ { "Position": [-123.11679620827039, 49.28147612192166] } ], "Destinations": [ { "Position": [-123.112317039, 49.28897192166] } ], "Avoid": { "Areas": [ { "Geometry": { "BoundingBox": [ -123.116561, 49.281517, -123.110165, 49.285689 ] } } ] }, "RoutingBoundary": { "Unbounded": true } }
Sample response
{ "ErrorCount": 0, "RouteMatrix": [ [ { "Distance": 1855, "Duration": 295 } ] ], "RoutingBoundary": { "Unbounded": true } }
cURL
curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/route-matrix?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origins": [ { "Position": [-123.11679620827039, 49.28147612192166] } ], "Destinations": [ { "Position": [-123.112317039, 49.28897192166] } ], "Avoid": { "Areas": [ { "Geometry": { "BoundingBox": [ -123.116561, 49.281517, -123.110165, 49.285689 ] } } ] }, "RoutingBoundary": { "Unbounded": true } }'
AWS CLI
aws geo-routes calculate-route-matrix --key ${YourKey} \ --origins '[{"Position": [-123.11679620827039, 49.28147612192166]}]' \ --destinations '[{"Position": [-123.112317039, 49.28897192166]}]' \ --avoid '{"Areas": [{"Geometry": {"BoundingBox": [-123.116561, 49.281517, -123.110165, 49.285689]}}]}' \ --routing-boundary '{"Unbounded": true}'
Sample request
{ "Origins": [ { "Position": [-123.11679620827039, 49.28147612192166] } ], "Destinations": [ { "Position": [-123.112317039, 49.28897192166] } ], "Avoid": { "TollRoads": true, "ControlledAccessHighways": true, "Ferries": true }, "RoutingBoundary": { "Unbounded": true } }
Sample response
{ "ErrorCount": 0, "RouteMatrix": [ [ { "Distance": 1855, "Duration": 295 } ] ], "RoutingBoundary": { "Unbounded": true } }
cURL
curl --request POST \ --url 'https://routes.geo.eu-central-1.amazonaws.com/v2/route-matrix?key=Your_key' \ --header 'Content-Type: application/json' \ --data '{ "Origins": [ { "Position": [-123.11679620827039, 49.28147612192166] } ], "Destinations": [ { "Position": [-123.112317039, 49.28897192166] } ], "Avoid": { "TollRoads": true, "ControlledAccessHighways": true, "Ferries": true }, "RoutingBoundary": { "Unbounded": true } }'
AWS CLI
aws geo-routes calculate-route-matrix --key ${YourKey} \ --origins '[{"Position": [-123.11679620827039, 49.28147612192166]}]' \ --destinations '[{"Position": [-123.112317039, 49.28897192166]}]' \ --avoid '{"TollRoads": true, "ControlledAccessHighways": true, "Ferries": true}' \ --routing-boundary '{"Unbounded": true}'