Compute Routes 개요
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.

소개
Compute Routes는 Routes API 서비스의 메서드로, HTTPS 요청을 수락하고 두 위치 간의 이상적인 경로를 반환합니다.
여러 위치 간의 대중교통, 자전거, 운전, 이륜차 또는 도보 경로를 실시간 교통정보를 기반으로 제공하세요.
경로 매트릭스가 필요하신가요? 경로 매트릭스에 관심이 있다면 Compute Route Matrix 개요를 참고하세요.
이전 중인가요? Distance Matrix API (기존)에서 이전하는 경우 Routes API로 이전해야 하는 이유부터 시작하는 이전 안내를 참고하세요.
Compute Routes를 사용하는 이유
Compute Routes를 사용하면 다양한 경로 세부정보를 통해 원하는 대로 차량이나 패키지의 경로를 설정하고 비용과 품질을 최적화할 수 있습니다.
Compute Routes로 할 수 있는 작업
Routes API Compute Routes
메서드를 사용하면 다음 작업을 할 수 있습니다.
다양한 이동 수단과 단일 또는 여러 목적지에 대한 경로를 확인할 수 있습니다.
이동 수단: 대중교통, 운전, 이륜차, 도보 또는 자전거
가장 효율적인 순서로 이동할 수 있도록 최적화할 수 있는 일련의 경유지입니다.
출발지, 도착지, 중간 지점을 지정하는 여러 가지 방법:
텍스트 문자열 예: '시카고, 일리노이', '다윈, NT, 오스트레일리아', '1800 Amphitheatre Parkway, Mountain View, CA 94043' 또는 'CWF6+FWX Mountain View, California'
장소 ID
위도 및 경도 좌표(선택적으로 차량 방향 포함)
필요와 목표에 따라 경로 옵션을 미세 조정합니다.
필드 마스크를 사용하여 필요한 데이터만 요청하여 지연 시간과 품질을 제어하세요. 이렇게 하면 불필요한 처리 시간과 요금이 더 높은 요청 청구율을 방지할 수 있습니다. 자세한 내용은 반환할 정보 선택하기를 참고하세요.
Compute Routes 작동 방식
Routes API ComputeRoutes
메서드는 요청 세부정보가 포함된 JSON 요청 본문이 있는 HTTP POST 요청을 수락합니다. 출처, 대상, travelMode
, 반환할 필드를 지정하는 필드 마스크가 필요합니다.
예
curl -X POST -d '{
"origin": {
"address": "1800 Amphitheatre Parkway, Mountain View, CA 94043"
},
"destination": {
"address": "Sloat Blvd &, Upper Great Hwy, San Francisco, CA 94132"
},
"travelMode": "DRIVE"
}' \
-H 'Content-Type: application/json' -H 'X-Goog-Api-Key: YOUR_API_KEY' \
-H 'X-Goog-FieldMask: routes.duration,routes.distanceMeters' \
'https://routes.googleapis.com/directions/v2:computeRoutes'
그러면 서비스가 요청된 경로를 계산하고 요청한 필드를 반환합니다.
리소스
다음 표에는 Routes API Compute Routes 메서드를 통해 사용할 수 있는 리소스와 반환되는 데이터가 요약되어 있습니다.
데이터 리소스 |
반환된 데이터 |
반환 형식 |
ComputeRoutes |
요청된 경우 대체 경로와 함께 경로, 구간, 경로의 단계를 반환합니다. |
JSON |
Compute Routes 사용 방법
사용 가능한 클라이언트 라이브러리
Compute Routes에 사용할 수 있는 클라이언트 라이브러리의 목록은 클라이언트 라이브러리를 참고하세요.
다음 단계
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-06-20(UTC)
[null,null,["최종 업데이트: 2025-06-20(UTC)"],[],[],null,["# Compute Routes Overview\n\n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n\n[](/maps/documentation/routes/demo)\n\nIntroduction\n------------\n\nCompute Routes is a method in the Routes API service that accepts\nan HTTPS request and returns the ideal route between two locations.\nProvide directions with real-time traffic for transit, biking, driving,\n2-wheel motorized vehicles, or walking between multiple locations.\n\n**Need Route Matrixes?** If you are interested in a route matrix, see\n[Compute Route Matrix Overview](/maps/documentation/routes/compute-route-matrix-over).\n\n**Migrating?** If you are migrating from the Distance Matrix API (Legacy),\nsee migration instructions starting with\n[Why migrate to the Routes API](/maps/documentation/routes/migrate-routes-why).\n\nWhy use Compute Routes\n----------------------\n\nWith Compute Routes, with a wide\nrange of route details you can route your vehicles or packages according to\nyour preferences while optimizing for cost and quality.\n\nWhat you can do with Compute Routes?\n------------------------------------\n\nWith the Routes API `Compute Routes` method, you can\ndo the following things:\n\n- **Get directions for different ways to travel**, and for a single or\n multiple destinations:\n\n - Modes of transportation: transit, driving, two-wheel vehicles,\n walking, or bicycling.\n\n - A series of waypoints that you can optimize for the most efficient\n order in which to travel to them.\n\n- **Use multiple ways to specify origins, destinations, and waypoints**:\n\n - Text strings. For example: \"Chicago, IL\", \"Darwin, NT, Australia\", \"1800\n Amphitheatre Parkway, Mountain View, CA 94043\", or \"CWF6+FWX Mountain\n View, California\"\n\n - Place IDs\n\n - Latitude and longitude coordinates, optionally with vehicle heading\n\n- **Fine-tune your route options** based on your needs and goals:\n\n - Select fuel or energy-efficient routes for your vehicle's engine type:\n Diesel, Electric, Hybrid, Gas. For more information, see\n [Get an eco-friendly route](/maps/documentation/routes/eco-routes#request_an_eco-friendly_route).\n\n - Set fine-grained options for traffic calculation, letting you make\n quality versus latency trade off decisions. For details, see\n [Specify how and if to include traffic data](/maps/documentation/routes/config_trade_offs).\n\n - Set vehicle heading (direction of travel) and side-of-road information\n for waypoints to increase ETA accuracy. For details, see\n [Specify vehicle heading and side of road](/maps/documentation/routes/location_modifiers).\n\n - Specify pass-through versus terminal locations and safe stopover\n locations. For details, see [Set a stop along a route](/maps/documentation/routes/stop_over) and\n [Set a point for a route to pass through](/maps/documentation/routes/pass-through).\n\n - Request toll information, along with route distance and ETA. For\n details, see\n [Calculate toll fees for a route](/maps/documentation/routes/calculate_toll_fees).\n\n- **Control your latency and quality** by requesting only the data you need\n using a field mask, which helps you avoid unnecessary processing time and\n higher request billing rates. For details, see\n [Choose what information to return](/maps/documentation/routes/choose_fields).\n\nHow Compute Routes works\n------------------------\n\nThe Routes API `ComputeRoutes` method accepts an HTTP POST request with\na JSON request body that contains the request details. Required are an origin,\ndestination, `travelMode`, and a field mask to specify which fields to return. \n\n#### Example\n\n```json\ncurl -X POST -d '{\n \"origin\": {\n \"address\": \"1800 Amphitheatre Parkway, Mountain View, CA 94043\"\n },\n \"destination\": {\n \"address\": \"Sloat Blvd &, Upper Great Hwy, San Francisco, CA 94132\"\n },\n \"travelMode\": \"DRIVE\"\n }' \\\n -H 'Content-Type: application/json' -H 'X-Goog-Api-Key: YOUR_API_KEY' \\\n -H 'X-Goog-FieldMask: routes.duration,routes.distanceMeters' \\\n 'https://routes.googleapis.com/directions/v2:computeRoutes'\n```\n\nThe service then calculates the requested route, and returns the fields you've\nrequested.\n\n### Resources\n\nThe following table summarizes the resources available through the\nRoutes API Compute Routes method,\nalong with the data it returns.\n\n\u003cbr /\u003e\n\n| Data resources | Data returned | Return format |\n|----------------------------------------------------------------------|-----------------------------------------------------------------------------------|---------------|\n| [ComputeRoutes](/maps/documentation/routes/compute_route_directions) | Returns routes, legs, and steps for a route, with alternate routes, if requested. | JSON |\n\n\u003cbr /\u003e\n\n### How to use Compute Routes\n\n|---|---------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 1 | **Get set up** | Start with [Set up your Google Cloud project](/maps/documentation/routes/cloud-setup) and complete the setup instructions that follow. |\n| 2 | **Understand how the Routes API bills** | For information, see [Usage and billing](/maps/documentation/routes/usage-and-billing). |\n| 3 | **Compute a route and review the response** | For more information, see [Get a route](/maps/documentation/routes/compute_route_directions) and [Review the route responses](/maps/documentation/routes/understand-route-response). |\n\n### Available client libraries\n\nFor a list of the available client libraries for\nCompute Routes, see\n[Client libraries](/maps/documentation/routes/client-libraries).\n\nWhat's next\n-----------\n\n- [Get a route](/maps/documentation/routes/compute_route_directions)\n- [Available route options](/maps/documentation/routes/route-opt)\n- [Choose what information to return](/maps/documentation/routes/choose_fields)\n- [Migrate from Directions API (Legacy)](/maps/documentation/routes/migrate-routes)\n- [Migrate from the Routes API preview to GA](/maps/documentation/routes/migrate-routes-preview)"]]