Is it possible to get an address from coordinates using google maps?

前端 未结 3 2040
臣服心动
臣服心动 2020-12-05 11:01

I\'m just curious. Maybe for a future project. I want to know if it\'s possible to retrieve an address from a giving coordinate via the Google API.

3条回答
  •  既然无缘
    2020-12-05 11:44

    TomTom Maps APIs provides with a Reverse Geocoding end point which gives a structured JSON.

    You can try it with the API Explorer.

    For example :

    curl -X GET "https://api.tomtom.com/search/2/reverseGeocode/37.8328,-122.27669.json?key=*****" -H "accept: */*"
    

    Will get you

    {
      "summary": {
        "queryTime": 6,
        "numResults": 1
      },
      "addresses": [
        {
          "address": {
            "buildingNumber": "1001",
            "streetNumber": "1001",
            "routeNumbers": [],
            "street": "42nd Street",
            "streetName": "42nd Street",
            "streetNameAndNumber": "1001 42nd Street",
            "countryCode": "US",
            "countrySubdivision": "CA",
            "countrySecondarySubdivision": "Alameda",
            "countryTertiarySubdivision": "Oakland",
            "municipality": "Oakland, Emeryville",
            "postalCode": "94608",
            "municipalitySubdivision": "Oakland, Emeryville",
            "country": "United States",
            "countryCodeISO3": "USA",
            "freeformAddress": "1001 42nd Street, Emeryville, CA 94608",
            "boundingBox": {
              "northEast": "37.832893,-122.276230",
              "southWest": "37.832777,-122.277006",
              "entity": "position"
            },
            "countrySubdivisionName": "California",
            "localName": "Emeryville"
          },
          "position": "37.832844,-122.276688"
        }
      ]
    }
    

    You can get a free API KEY (no credit card needed) and try our tutorials!

    Disclosure: I am employed at TomTom.

提交回复
热议问题