In fact, you don't even need an API, this can be done manually via browser, or by fetching the url with some script and parsing the result.
The link is in this format:
https://maps.googleapis.com/maps/api/geocode/json?latlng=[LAT,LON]&sensor=true
Example:
https://maps.googleapis.com/maps/api/geocode/json?latlng=45.668483,14.18955&sensor=true
The result can be in JSON or XML format.
Documentation: https://developers.google.com/maps/documentation/geocoding/#JSON
JSON example result:
{ "results" : [ { "address_components" : [ { "long_name" : "51", "short_name" : "51", "types" : [ "street_number" ] }, { "long_name" : "Kolodvorska cesta", "short_name" : "Kolodvorska cesta", "types" : [ "route" ] }, { "long_name" : "Pivka", "short_name" : "Pivka", "types" : [ "locality", "political" ] }, { "long_name" : "Slovenia", "short_name" : "SI", "types" : [ "country", "political" ] }, { "long_name" : "6257", "short_name" : "6257", "types" : [ "postal_code" ] }, { "long_name" : "Pivka", "short_name" : "Pivka", "types" : [ "postal_town" ] } ], "formatted_address" : "Kolodvorska cesta 51, 6257 Pivka, Slovenia",
No comments:
Post a Comment