차량 공유 이동에 가장 적합한 경로를 결정할 때 가장 빠른 경로가 항상 최선의 선택은 아닙니다. 경로를 계획하는 것이 좋습니다.
Routes Preferred API를 사용하면 ComputeCustomRoutes 메서드를 사용하여 경로 목표를 지정하여 경로를 계획할 수 있습니다.
ComputeCustomRoutes 메서드는 운전자가 선택한 경로와 운전한 경로 간의 차이를 최소화하여 경로 규정을 준수하는 데도 도움이 됩니다.
Routes Preferred API와 Navigation SDK를 모두 사용하여 경로 계획의 모든 이점을 누리세요.
ComputeCustomRoutes 메서드 사용 설정
코드에서 ComputeCustomRoutes 메서드를 사용하려면 먼저 사용 설정해야 합니다. Routes Preferred API 메서드 사용 설정에 관한 자세한 내용은 시작하기를 참고하세요.
ComputeCustomRoutes 메서드 사용
ComputeCustomRoutes 메서드를 사용하려면 입력에 응답 필드 마스크를 지정해야 합니다. URL 매개변수 $fields 또는 fields를 사용하거나 HTTP/gRPC 헤더 X-Goog-FieldMask를 사용하여 응답 필드 마스크를 제공할 수 있습니다. 자세한 내용은 시스템 매개변수를 참고하세요.
필드 마스크 값은 쉼표로 구분된 필드 경로 목록입니다. 각 필드 경로는 메시지 계층 구조를 나타내는 필드 이름의 목록으로, 점으로 구분됩니다.
필드 이름은 JSON 객체 키 또는 protobuf 필드 태그 이름입니다.
필드 경로는 최상위 응답 메시지 유형에서 시작하며, 선택적으로 하나 이상의 점과 다음 수준의 필드 이름이 뒤에 올 수 있습니다. 일반적으로 필드 경로는 다음과 같이 구성됩니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-11-23(UTC)"],[[["The Routes Preferred API's `ComputeCustomRoutes` method enables planning routes based on objectives beyond the fastest route, such as compliance or driver preferences."],["`ComputeCustomRoutes` supports optimizing routes for `DRIVE` and `TWO_WHEELER` travel modes, but excludes intermediate waypoints and other travel modes."],["Using the Routes Preferred API with the Navigation SDK provides the best route planning outcomes, though they can utilize separate cloud projects."],["Before using the `ComputeCustomRoutes` method, enable it and verify your quota limits, requesting increases if necessary through Google Cloud Support."],["To specify desired data in the response, use field masks with the `ComputeCustomRoutes` method, selecting fields using dot-separated paths from the top-level response."]]],["The Routes Preferred API's `ComputeCustomRoutes` method allows route planning by specifying a route objective and minimizing deviations from the operator's selected route. This method supports `DRIVE` and `TWO_WHEELER` travel modes, excluding `via` waypoints. To use it, enable the method and specify a response field mask via `$fields`, `fields`, or `X-Goog-FieldMask`. Quota limits should be monitored. Use alongside the Navigation SDK to maximize route planning benefits. Additionally, toll fees can be calculated using this API.\n"]]