nearest Roads
GET https://roads.googleapis.com/v1/nearestRoads?points=<string>|<string>
This service returns individual road segments for a given set of GPS coordinates. This services takes up to 100 GPS points and returns the closest road segment for each point. The points passed do not need to be part of a continuous path.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
points | string | (Required) The path to be snapped. The path parameter accepts a list of latitude/longitude pairs. Latitude and longitude values should be separated by commas. Coordinates should be separated by the pipe character: " | |
<div class="note">Note: The snapping algorithm works best for points that are not too far apart. If you observe odd snapping behavior, try creating paths that have points closer together. To ensure the best snap-to-road quality, you should aim to provide paths on which consecutive pairs of points are within 300m of each other. This will also help in handling any isolated, long jumps between consecutive points caused by GPS signal loss, or noise.</div> | |||
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Accept | string |
RESPONSES
status: OK
{"snappedPoints":[{"location":{"latitude":88441122.26690334,"longitude":12352141.930863738},"placeId":"do consequat id","originalIndex":-12608215.018332243},{"location":{"latitude":-94456748.83172014,"longitude":42911047.81595835},"placeId":"laborum u","originalIndex":-23092839.797481135}]}