[Geocoding] reverse geocode a set of co-ordinates

Josef Tupag joseftupag at gmail.com
Tue Jun 22 20:08:22 BST 2010


I have sets of co-ordinates in the following format

(-33.9,18.6)

How do I go about getting the name of the nearest town or Country for those
co-ords? I'm guessing it will involve Javascript, but am happy to also use
PHP if appropriate?

Am trying the Google Reverse
Geocoder<http://code.google.com/apis/maps/documentation/services.html#ReverseGeocoding>but
having trouble with it. The following code is pretty identical to one
of
their examples but doesn't seem to be running at all... any ideas why?

<script type="text/javascript" charset="utf-8">
            function reverseGeocode(lat,lon){

                var geocoder = new GClientGeocoder();
                var latlng = new GLatLng(lat, lon);
                geocoder.getLocations(latlng, function(addresses) {
                    alert(addresses);
                });

            }
        </script>

Josef Tupag - best humidifier <http://thebesthumidifiers.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/geocoding/attachments/20100622/397598f8/attachment.html>


More information about the Geocoding mailing list