How to correctly and clearly identify the address (e.g. Paris. France) of the coordinates using Google Reverse geocoding? Somewhere locations are marked by type “locality”, somewhere “administrative_area_level_2”, somewhere “administrative_area_level_3” etc. Is there any method to clearly determine the town or village or if the person is outside built-up areas?
Example: We send request: https://maps.googleapis.com/maps/api/geocode/json?sensor=true&language=en&latlng=55.6844952,37.6118719 Look for the city and In most cases get the following:
"address_components" : [
{
"long_name" : "Moscow",
"short_name" : "Moscow",
"types" : [ "locality", "political" ]
},
…
},
"place_id" : "...",
"types" : [ "locality" ]
},
But sometimes we send request: https://maps.googleapis.com/maps/api/geocode/json?sensor=true&language=en&latlng=60.123062,64.78818 Look for the city and get:
"address_components" : [
{
"long_name" : " gorod Uray",
"short_name" : "g. Uray",
"types" : [ "administrative_area_level_2", "political" ]
},
...
},
"place_id" : "...",
"types" : [ "administrative_area_level_2" ]
},
How the app can determine that in one case city is “locality”, and in other case city is “administrative_area_level_2” etc.