X-Goog-Fieldmask는 응답에서 필요한 필드의 쉼표로 구분된 목록으로 설정해야 합니다. 예를 들어 X-Goog-FieldMask: originIndex,destinationIndex,duration,distanceMeters,status입니다.
와일드 카드 문자 (*)를 사용하여 모든 필드를 나타낼 수 있지만 권장하지는 않습니다. 와일드 카드 문자를 사용하여 API 응답을 테스트하고 이해하되, 프로덕션 코드의 필드 마스크에 원하는 필드를 명시적으로 나열하세요.
ComputeRouteMatrix 메서드의 한 가지 특징은 전체 스트림 또는 개별 요소에 대해 오류 코드를 반환할 수 있다는 것입니다. 예를 들어 요청이 잘못된 경우 (예: 원본이 0개임) 스트림 연결에서 오류가 반환됩니다. 하지만 오류가 스트림의 일부 요소에만 적용되는 경우 (예: 원본에 잘못된 장소 ID를 설정하는 경우) 오류의 영향을 받는 요소에만 오류 코드가 포함됩니다.
스트림에서 반환된 요소는 순서가 보장되지 않습니다. 이 때문에 각 요소에는 origin_index와 destination_index가 포함됩니다. 요청에 의해 지정된 출발지와 목적지의 경우, 경로 출발지는 지정된 요소에 대해 origins[origin_index]와 동일하고 경로 목적지는 destinations[destination_index]와 동일합니다. 이러한 배열은 0부터 시작하는 색인입니다. 출발지 및 도착지 목록 순서를 저장하는 것이 중요합니다.
[[["이해하기 쉬움","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"]],["최종 업데이트: 2025-09-10(UTC)"],[[["\u003cp\u003eThe \u003ccode\u003eComputeRouteMatrix\u003c/code\u003e method in the Routes Preferred API calculates distances and durations for multiple origin-destination pairs, offering advantages like streaming results and traffic calculation options.\u003c/p\u003e\n"],["\u003cp\u003eIt's necessary to enable the \u003ccode\u003eComputeRouteMatrix\u003c/code\u003e method and understand quota limits before implementation, ensuring compliance with Google Maps Platform terms.\u003c/p\u003e\n"],["\u003cp\u003eThe method can be accessed through gRPC or REST, with specific steps outlined for using gRPC, including generating protobuffer code and configuring requests.\u003c/p\u003e\n"],["\u003cp\u003eResponses include \u003ccode\u003eorigin_index\u003c/code\u003e and \u003ccode\u003edestination_index\u003c/code\u003e to correlate results with input data since the order of elements is not guaranteed.\u003c/p\u003e\n"],["\u003cp\u003eToll fee calculation functionality is available within \u003ccode\u003eComputeRouteMatrix\u003c/code\u003e, allowing developers to incorporate toll costs into route planning.\u003c/p\u003e\n"]]],["The `ComputeRouteMatrix` method of the Routes Preferred API calculates route distance and duration for multiple origins and destinations via streaming gRPC or REST HTTP calls. It offers lower latency, fine-grained traffic options, higher availability, waypoint specifications, and toll information. To use it, enable the method, and send requests with API key and field mask. The method returns elements with `origin_index` and `destination_index`. Error codes can be returned for the entire stream or per individual element.\n"],null,[]]