āĻ•āĻžāϛ⧇āϰ āϰāĻžāĻ¸ā§āϤāĻž

Roads API 100āϟāĻŋ āĻĒāĻ°ā§āϝāĻ¨ā§āϤ āĻ¸ā§āĻŦāϤāĻ¨ā§āĻ¤ā§āϰ āĻ¸ā§āĻĨāĻžāύāĻžāĻ™ā§āĻ• āύ⧇āϝāĻŧ āĻāĻŦāĻ‚ āĻĒā§āϰāϤāĻŋāϟāĻŋ āĻĒāϝāĻŧ⧇āĻ¨ā§āĻŸā§‡āϰ āϜāĻ¨ā§āϝ āύāĻŋāĻ•āϟāϤāĻŽ āϰāĻžāĻ¸ā§āϤāĻžāϰ āĻ…āĻ‚āĻļ āĻĒā§āϰāĻĻāĻžāύ āĻ•āϰ⧇āĨ¤ āĻĒāĻžāϏ āĻ•āϰāĻž āĻĒāϝāĻŧ⧇āĻ¨ā§āϟāϗ⧁āϞāĻŋāϕ⧇ āĻāĻ•āϟāĻžāύāĻž āĻĒāĻĨ⧇āϰ āĻ…āĻ‚āĻļ āĻšāϤ⧇ āĻšāĻŦ⧇ āύāĻžāĨ¤

āφāĻĒāύāĻŋ āϝāĻĻāĻŋ āĻ…āύ⧁āĻ•ā§āϰāĻŽāĻŋāĻ• GPS āĻĒāϝāĻŧ⧇āĻ¨ā§āϟ āύāĻŋāϝāĻŧ⧇ āĻ•āĻžāϜ āĻ•āϰ⧇āύ, āϤāĻžāĻšāϞ⧇ Snap to Roads āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧁āύāĨ¤

āĻ…āύ⧁āϰ⧋āϧ

āύāĻŋāĻ•āϟāϤāĻŽ āϰāĻžāĻ¸ā§āϤāĻžāϗ⧁āϞāĻŋāϤ⧇ āĻāĻ•āϟāĻŋ āĻ…āύ⧁āϰ⧋āϧ āĻ…āĻŦāĻļā§āϝāχ HTTPS āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧇ āĻĒāĻžāĻ āĻžāϤ⧇ āĻšāĻŦ⧇ āĻāĻŦāĻ‚ āύāĻŋāĻŽā§āύāϞāĻŋāĻ–āĻŋāϤ āĻĢāĻ°ā§āĻŽāϟāĻŋ āĻ—ā§āϰāĻšāĻŖ āĻ•āϰāϤ⧇ āĻšāĻŦ⧇:

https://roads.googleapis.com/v1/nearestRoads?parameters&key=YOUR_API_KEY

Required parameters

  • points

    The points to be snapped. The points parameter accepts a list of latitude/longitude pairs. Separate latitude and longitude values with commas. Separate coordinates with the pipe character: "|". For example: points=60.170880,24.942795|60.170879,24.942796|60.170877,24.942796 .

āωāĻĻāĻžāĻšāϰāĻŖ

āύāĻŋāĻŽā§āύāϞāĻŋāĻ–āĻŋāϤ āĻ…āύ⧁āϰ⧋āϧāϟāĻŋ āĻ¸ā§āĻĨāĻžāύāĻžāĻ™ā§āϕ⧇āϰ āύāĻŋāĻ°ā§āĻĻāĻŋāĻˇā§āϟ āϤāĻžāϞāĻŋāĻ•āĻžāϰ āωāĻĒāϰ āĻ­āĻŋāĻ¤ā§āϤāĻŋ āĻ•āϰ⧇ āϰāĻžāĻ¸ā§āϤāĻžāϰ āĻ…āĻ‚āĻļāϗ⧁āϞāĻŋāϰ āĻāĻ•āϟāĻŋ āϏ⧇āϟ āĻĒā§āϰāĻĻāĻžāύ āĻ•āϰ⧇⧎

URL

https://roads.googleapis.com/v1/nearestRoads
  ?points=60.170880%2C24.942795%7C60.170879%2C24.942796%7C60.170877%2C24.942796
  &key=YOUR_API_KEY

cURL

curl -L -X GET '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 āĻ…āύ⧁āϰ⧋āϧ URL-āĻāϰ āĻŽāĻ§ā§āϝ⧇ āύāĻŋāĻ°ā§āĻĻ⧇āĻļāĻŋāϤ āĻŦāĻŋāĻ¨ā§āϝāĻžāϏ⧇ āĻāĻ•āϟāĻŋ āĻĒā§āϰāϤāĻŋāĻ•ā§āϰāĻŋāϝāĻŧāĻž āĻĒā§āϰāĻĻāĻžāύ āĻ•āϰāĻŦ⧇āĨ¤

{
  "snappedPoints":
    [
      {
        "location":
          { "latitude": 60.170878428876755, "longitude": 24.94269540970182 },
        "originalIndex": 0,
        "placeId": "ChIJfVFHrM0LkkYRBzUQos_jR5w",
      },
      {
        "location":
          { "latitude": 60.17087741412199, "longitude": 24.942695474405202 },
        "originalIndex": 1,
        "placeId": "ChIJfVFHrM0LkkYRBzUQos_jR5w",
      },
      {
        "location":
          { "latitude": 60.170875416131736, "longitude": 24.942695601802203 },
        "originalIndex": 2,
        "placeId": "ChIJfVFHrM0LkkYRBzUQos_jR5w",
      },
    ],
}

āĻĒā§āϰāϤāĻŋāĻ•ā§āϰāĻŋāϝāĻŧāĻž āύāĻŋāĻŽā§āύāϞāĻŋāĻ–āĻŋāϤ āĻ¸ā§āĻ•āĻŋāĻŽāĻž āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧇.

NearestRoadsResponse

FieldRequiredTypeDescription
optional Array< SnappedPoint >

An array of snapped points. Sometimes containing several snapped points for the same point with differing placeId or location.

See SnappedPoint for more information.

SnappedPoint

FieldRequiredTypeDescription
required LatitudeLongitudeLiteral See LatitudeLongitudeLiteral for more information.
required string

A unique identifier for a place. All place IDs returned by the Roads API correspond to road segments.

optionalnumber

An integer that indicates the corresponding value in the original request. Each value in the request should map to a snapped value in the response. However, if you've set interpolate=true or if you're using nearest roads, then it's possible that the response will contain more coordinates than the request. Interpolated values will not have an originalIndex . These values are indexed from 0 , so a point with an originalIndex of 4 will be the snapped value of the 5th latitude/longitude passed to the path parameter. Nearest Roads points may contain several points for single coordinates with differing location or placeId.

LatitudeLongitudeLiteral

An object describing a specific location with Latitude and Longitude in decimal degrees.

FieldRequiredTypeDescription
required number

Latitude in decimal degrees

required number

Longitude in decimal degrees