

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

# 출발지 및 목적지의 경로를 찾는 방법
<a name="calculate-routes-origin-destination-waypoints"></a>

CalculateRoutes API를 사용하면 출발지와 목적지 간 최적의 경로와 드라이버의 휴식을 위한 최적의 기회를 찾을 수 있습니다. 트럭, 보행자, 자동차 및 스쿠터와 같은 이동 모드를 지원합니다. 또한 출발지 및 목적지를 포함하여 최대 25개의 중간 지점(경유지)을 지원하며 몇 가지 제약 조건만 있습니다.

## 잠재적 사용 사례
<a name="potential-use-cases"></a>
+ **지점 간 경로 찾기:** 다양한 이동 모드와 추가 옵션을 기반으로 두 위치 간 최적의 경로를 결정합니다.

## 예제
<a name="calculate-routes-examples"></a>

### Car TravelMode를 사용하여 출발지에서 목적지까지의 경로 계산
<a name="calculate-routes-car-mode"></a>

------
#### [ 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
```

------