요청에 경로 수정자를 추가하여 통행료 또는 고속도로를 피하는 등 피하려는 경로 지형지물을 지정합니다. 그러면 API는 이러한 기능이 필요하지 않은 경로를 제공하려고 시도합니다.
요청에서 RouteModifiers 유형의 routeModifiers 속성을 사용합니다. avoidTolls, avoidHighways, avoidFerries, avoidIndoor를 지정할 수 있습니다.
경로 수정자를 지정한다고 해서 제한된 지형지물이 포함된 경로가 반드시 제외되는 것은 아닙니다. API는 수정자를 사용하여 결과를 더 유리한 경로로 편향시킵니다. 우회 옵션을 요청해도 경로가 변경되지 않는 데는 몇 가지 이유가 있을 수 있습니다. 예를 들어 출발지에서 목적지로 가는 유일한 경로로 인해 고속도로나 페리를 피할 수 없는 경우입니다. 또는 대체 경로로 인해 이동 시간이 실제로 크게 늘어납니다.
다음 예는 computeRoutes 메서드 (REST) 요청 본문에서 경로 수정자를 설정하는 방법을 보여줍니다. ComputeRoutes 메서드 (gRPC)에 이 옵션을 지정할 수도 있습니다. 이 예에서는 유료도로 및 고속도로를 피하도록 지정합니다.
[null,null,["최종 업데이트: 2025-02-06(UTC)"],[[["The Routes API's Compute Route Matrix feature does not support avoiding route features."],["You can request routes that avoid tolls, highways, ferries, and indoor travel using the `routeModifiers` property."],["While route modifiers bias the results, they may not eliminate the specified features if alternatives are unavailable or significantly increase travel time."],["You can specify route modifiers in both REST and gRPC requests, using the `avoidTolls`, `avoidHighways`, `avoidFerries`, and `avoidIndoor` fields within the `routeModifiers` property."]]],[]]