In my project, I use the Google Geocoding and Reverse Geocoding APIs to verify the addresses and latlng provided by end users.
Given latlng -37.857866,144.950706, the reverse geocoding API ( https://maps.googleapis.com/maps/api/geocode/json?latlng=-37.857866,144.950706 ) returns the nearest land address.
However, on the Google Map webpage, this latlng is actually at sea: https://www.google.com.au/maps/search/-37.857866,144.950706
Anyway, can I tell the Google Reverse Geocoding API not to return the nearest land address to me? In a real project, in fact, I provide an API key and specify location types, for example. https://maps.googleapis.com/maps/api/geocode/json?key=<API_Key> & location_type = ROOFTOP & latlng = -37.857866,144.950706 and I just think that if the location indicated by latlng is not a ROOFTOP address, Google should return me ZERO_RESULTS.
Further update: just to clarify that my project requires client addresses, and some of them prefer to provide a LatLng site, so I need to convert LatLng to the actual address and show an error message if LatLng is invalid or at sea so the client can double verify. Using your nearest mailing address is error prone.
If the Reverse Geocoding API is not suitable for this, then please report it for this Google Maps API. Thank.
source
share