Roads API 개요
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Roads API는 지도상의 하나 이상의 지점에 대한 위도/경도 좌표를 사용하여 HTTPS 요청을 수락하는 서비스입니다. 이러한 포인트를 사용하여 근처 도로 세그먼트를 찾고 가장 가까운 도로 세그먼트 및 제한 속도와 같은 메타데이터와 함께 장소 ID를 반환합니다.
Roads API를 사용해야 하는 이유
Roads API를 사용하면 제한속도, 예상 도착 시간 또는 기타 도로 메타데이터를 가져올 수 있습니다. 이 도로 메타데이터를 사용하면 다음 기능을 통해 운전 앱을 개선할 수 있습니다.
- 위도/경도 좌표를 도로와 연결합니다.
- 좌표 집합에 가장 가까운 도로 찾기
- 도로 구간의 속도 제한 가져오기
Roads API 버전으로 수행할 수 있는 작업
Roads API를 사용하면 GPS 좌표를 도로의 지오메트리에 매핑하고 도로 구간을 따라 속도 제한을 확인할 수 있습니다.
- 도로에 맞추기 이 서비스는 제공된 GPS 좌표 집합을 기반으로 이동한 것으로 보이는 도로를 반환합니다. 경로를 따라 수집된 GPS 포인트를 최대 100개까지 지정할 수 있습니다. 원하는 경우 서비스에서 추가 포인트를 보간하도록 요청하여 도로의 지오메트리를 부드럽게 따르는 경로를 만들 수도 있습니다.
- Nearest Roads 이 서비스는 GPS 지점의 가장 가까운 도로 구간을 반환합니다. GPS 포인트는 최대 100개까지 지정할 수 있습니다. 지정하는 포인트가 연속된 경로에 포함될 필요는 없습니다.
- 속도 제한 이 서비스는 도로 구간의 규정 속도 제한을 반환합니다. 속도 제한 서비스는 애셋 추적 라이선스가 있는 모든 고객이 사용할 수 있습니다. 사용한 만큼만 지불하는 가격으로 전환한 Google Maps Platform 프리미엄 플랜 고객의 경우 이 기능이 활성 상태로 유지됩니다.
Roads API의 작동 방식
Roads API는 위도/경도 좌표 또는 장소 ID를 허용하는 세 개의 엔드포인트를 사용하여 도로 경로, 구간 또는 제한 속도 데이터를 제공합니다.
다음 예는 위도/경도 좌표 집합을 기반으로 가장 가까운 도로를 요청하는 방법을 보여줍니다.
https://roads.googleapis.com/v1/nearestRoads
?points=60.170880%2C24.942795%7C60.170879%2C24.942796%7C60.170877%2C24.942796
&key=YOUR_API_KEY
리소스
다음 표에는 Roads API를 통해 사용할 수 있는 리소스와 반환되는 데이터가 요약되어 있습니다.
데이터 리소스 |
반환된 데이터 |
반환 형식 |
경로에 맞추기
|
경로에서 최대 100개의 GPS 포인트 배열을 반환합니다. 도로에 스냅된 경도/위도 좌표와 장소 ID가 포함됩니다. 도로에 맞추기 가이드의 응답에서 자세한 내용을 확인하세요.
|
|
가장 가까운 도로
|
최대 100개의 독립된 위도/경도 좌표와 각 지정된 지점에서 가장 가까운 도로의 장소 ID 배열입니다.
포인트가 연속적일 필요는 없습니다. 가장 가까운 도로 가이드의 응답에서 자세한 내용을 확인하세요.
|
속도 제한
|
최대 100개의 도로 메타데이터 요소 배열입니다. 여기에는 속도 제한과 장소 ID가 포함되며 단위는 KPH 또는 MPH입니다. 속도 제한 가이드의 응답에서 자세한 내용을 확인하세요.
|
Roads API 사용 방법
1 |
도로에 맞추기 데모 사용해 보기 |
데모를 클릭하여 트랙을 만들고 도로에 맞추기 엔드포인트가 부드러운 데이터를 제공하는 방법을 확인하세요. 도로에 스냅 가이드의 데모를 참고하세요. API 키가 필요하지 않습니다.
|
2 |
설정하기 |
Google Cloud 프로젝트 설정부터 시작하여 이어지는 설정 안내를 완료한 다음 API 키 사용 방법을 알아봅니다.
|
3 |
도로에 맞추기 요청 시도 |
도로에 맞추기 예시 중 하나를 사용하여 사용 사례와 관련된 예시를 시도해 보세요.
|
4 |
도로 경로의 속도 제한 가져오기 |
도로에 맞추기 요청에 제공한 것과 동일한 경로 데이터를 사용하여 제한 속도 쿼리를 실행합니다. 경로를 사용하는 요청 예를 참고하세요.
|
5 |
긴 경로 처리 방법 알아보기 |
고급 개념 가이드의 긴 경로 처리 섹션을 따르세요.
|
6 |
자체 앱에 도로 데이터를 통합하세요 |
도로 스냅 데모의 자세한 코드 예시를 참고하여 자체 앱에 도로 데이터 기능을 빌드하세요.
|
사용 가능한 클라이언트 라이브러리
다음 클라이언트 라이브러리 중 하나를 통해 원하는 언어로 이 API를 호출합니다.
Google 지도 서비스용 Java Client, Python Client, Go Client, Node.js Client는 커뮤니티 지원 클라이언트 라이브러리로, Apache 2.0 라이선스에 따라 오픈 소스로 제공됩니다.
GitHub에서 다운로드하세요. GitHub에서는 설치 안내와 샘플 코드도 찾을 수 있습니다.
다음 단계
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-31(UTC)
[null,null,["최종 업데이트: 2025-08-31(UTC)"],[[["\u003cp\u003eThe Roads API enhances maps applications by connecting coordinates with roads, finding nearby roads, and providing speed limit data.\u003c/p\u003e\n"],["\u003cp\u003eIt offers three core functionalities: snapping GPS points to roads, identifying nearest roads, and retrieving speed limits.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can leverage client libraries for Java, Python, Go, and Node.js to integrate the Roads API.\u003c/p\u003e\n"],["\u003cp\u003eThe API accepts latitude/longitude coordinates and returns data like Place IDs, road segments, and speed limits in JSON format.\u003c/p\u003e\n"],["\u003cp\u003eYou can get started by exploring the documentation, trying the demo, setting up a Google Cloud project, and experimenting with code examples.\u003c/p\u003e\n"]]],["The Roads API processes HTTPS requests with latitude/longitude coordinates to identify nearby road segments. It offers three main services: Snap to Roads, which maps up to 100 GPS points to road geometry; Nearest Roads, which identifies the closest road segment for up to 100 independent GPS points; and Speed Limits, which returns posted speed limits and place IDs for road segments. Users can integrate these functionalities using client libraries or by making direct requests with an API key.\n"],null,["# Roads API overview\n\nThe Roads API is a service that accepts HTTPS requests with latitude/longitude coordinates for one or more points on a map. It uses these points to find nearby road segments and returns a Place ID along with metadata such as the nearest road segment and speed limits.\n\nWhy use the Roads API\n---------------------\n\nWith the Roads API, you can get speed limits, estimated\narrival times, or other road metadata. With this road\nmetadata, you can enhance your driving apps with the follow capabilities:\n\n- Connect latitude/longitude coordinates with a road or roads.\n- Find the nearest road for a set of coordinates\n- Get speed limits for road segments\n\nWhat you can do with the Roads API\n----------------------------------\n\nWith the Roads API, you can map GPS coordinates to the\ngeometry of the road, and determine the speed limit along road\nsegments.\n\n- **[Snap to Roads](/maps/documentation/roads/snap)** This service returns the most likely roads traveled based on the provided set of GPS coordinates. You can specify up to 100 GPS points collected along a route. Optionally, you can also request that the service interpolates additional points, resulting in a path that smoothly follows the geometry of the road.\n- **[Nearest Roads](/maps/documentation/roads/nearest)** This service returns the nearest road segment for a GPS point. You can specify up to 100 GPS points. The points you specify don't need to be part of a continuous path.\n- **[Speed limits](/maps/documentation/roads/speed-limits)** This service returns the posted speed limit for a road segment. The Speed Limit service is available to all customers with an Asset Tracking license. For [Google Maps Platform Premium Plan](/maps/premium) customers who transitioned to pay-as-you-go pricing, the feature remains active.\n\nHow the Roads API works\n-----------------------\n\nThe Roads API uses three endpoints which accept latitude/longitude\ncoordinates or place IDs to provide road paths, segments, or speed limit data.\nThe following example shows a request for nearest roads based on a set\nof latitude/longitude coordinates: \n\n```scdoc\nhttps://roads.googleapis.com/v1/nearestRoads\n ?points=60.170880%2C24.942795%7C60.170879%2C24.942796%7C60.170877%2C24.942796\n &key=YOUR_API_KEY\n```\n\n### Resources\n\nThe following table summarizes the resources available through the\nRoads API along with the data it returns.\n\n\u003cbr /\u003e\n\n| Data resources | Data returned | Return format |\n|------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|\n| **[Snap to roads](/maps/documentation/roads/snap)** | Returns an array of up to 100 GPS points from a route. Includes road-snapped longitude/latitude coordinates along with place IDs. See details in [Responses](/maps/documentation/roads/snap#responses) in the Snap to roads guide. | - JSON |\n| **[Nearest roads](/maps/documentation/roads/nearest)** | An array of up to 100 independent latitude/longitude coordinates along with place IDs for the nearest road for each specified point. Points do not need to be continuous. See details in [Responses](/maps/documentation/roads/nearest#responses) in the Nearest roads guide. | - JSON |\n| **[Speed limits](/maps/documentation/roads/speed-limits)** | An array of up to 100 road metadata elements. These contain speed limits and place IDs, with units either in KPH or MPH. See details in [Responses](/maps/documentation/roads/nearest#responses) in the Speed limits guide. | - JSON |\n\n\u003cbr /\u003e\n\nHow to use the Roads API\n------------------------\n\n|---|----------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 1 | **Try the snap to roads demo** | Click the demo to create a track and see how the snap to roads endpoint provides smooth data. See [Demo](/maps/documentation/roads/snap#demo) in the **Snap to roads** guide. You don't need an API key. |\n| 2 | **Get set up** | Start with [Set up your Google Cloud project](/maps/documentation/roads/cloud-setup) and complete the setup instructions that follow and then learn [how to use your API key](/maps/documentation/roads/get-api-key). |\n| 3 | **Try a snap to roads request** | [Use one of the snap to roads examples](/maps/documentation/roads/snap#examples) and try one relevant to your use case. |\n| 4 | **Get speed limits for your road path** | Using the same path data you provided for your snap to roads request, issue a speed limit query. See the [Example request using a path](/maps/documentation/roads/speed-limits#example_request_using_a_path). |\n| 5 | **Learn how to process long paths** | Follow the sections on [Processing long paths](/maps/documentation/roads/advanced#processing_long_paths) in the **Advanced concepts** guide. |\n| 6 | **Incorporate road data into your own app!** | See the [detailed code example](/maps/documentation/roads/snap#javascript-+-html) from the road snapped demo to start building road data functionality into your own app. |\n\n### Available client libraries\n\nCall this API in the language of\nyour choice through one of the following client libraries:\n\n- [Java\n Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-java)\n- [Python\n Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-python)\n- [Go Client\n for Google Maps Services](https://github.com/googlemaps/google-maps-services-go)\n- [Node.js\n Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-js)\n\nThe Java Client, Python Client, Go Client and Node.js Client for Google Maps\nServices are community-supported client libraries, open sourced under the\n[Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).\nDownload them from GitHub, where you can also find installation instructions and sample code.\n\nWhat's next\n-----------\n\n- **Try out the Roads API** : Go to [Roads Inspector](/maps/documentation/roads/inspector)\n- **Learn how to make Roads API requests** : Go to the service you're interested in:\n - [Snap to roads](/maps/documentation/roads/snap)\n - [Nearest roads](/maps/documentation/roads/nearest)\n - [Speed limits](/maps/documentation/roads/speed-limits)\n- **Understand Advanced Concepts** : Go to [Advanced Concepts](/maps/documentation/roads/advanced)\n- **Follow best practices** : Go to [Web Services Best Practices](/maps/documentation/roads/web-service-best-practices)"]]