Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>What you describe is called <a href="http://en.wikipedia.org/wiki/Reverse_geocoding" rel="noreferrer">Reverse Geocoding</a>. Google provides a <a href="http://code.google.com/apis/maps/documentation/geocoding/" rel="noreferrer">Geocoding Web Service API</a> which you can call from your server-side application (using any language) <a href="http://code.google.com/apis/maps/documentation/geocoding/#ReverseGeocoding" rel="noreferrer">to do reverse geocoding</a>.</p> <p>For example, the following request:</p> <blockquote> <p><a href="http://maps.google.com/maps/api/geocode/xml?latlng=40.714224,-73.961452&amp;sensor=false" rel="noreferrer">http://maps.google.com/maps/api/geocode/xml?latlng=40.714224,-73.961452&amp;sensor=false</a></p> </blockquote> <p>... will return a response that looks like the following (truncated):</p> <pre><code>&lt;GeocodeResponse&gt; &lt;status&gt;OK&lt;/status&gt; &lt;result&gt; &lt;type&gt;street_address&lt;/type&gt; &lt;formatted_address&gt;277 Bedford Ave, Brooklyn, NY 11211, USA&lt;/formatted_address&gt; &lt;address_component&gt; &lt;long_name&gt;277&lt;/long_name&gt; &lt;short_name&gt;277&lt;/short_name&gt; &lt;type&gt;street_number&lt;/type&gt; &lt;/address_component&gt; &lt;address_component&gt; &lt;long_name&gt;Bedford Ave&lt;/long_name&gt; &lt;short_name&gt;Bedford Ave&lt;/short_name&gt; &lt;type&gt;route&lt;/type&gt; &lt;/address_component&gt; &lt;address_component&gt; &lt;long_name&gt;Brooklyn&lt;/long_name&gt; &lt;short_name&gt;Brooklyn&lt;/short_name&gt; &lt;type&gt;sublocality&lt;/type&gt; &lt;type&gt;political&lt;/type&gt; &lt;/address_component&gt; &lt;address_component&gt; &lt;long_name&gt;New York&lt;/long_name&gt; &lt;short_name&gt;New York&lt;/short_name&gt; &lt;type&gt;locality&lt;/type&gt; &lt;type&gt;political&lt;/type&gt; &lt;/address_component&gt; &lt;address_component&gt; &lt;long_name&gt;Kings&lt;/long_name&gt; &lt;short_name&gt;Kings&lt;/short_name&gt; &lt;type&gt;administrative_area_level_2&lt;/type&gt; &lt;type&gt;political&lt;/type&gt; &lt;/address_component&gt; &lt;address_component&gt; &lt;long_name&gt;New York&lt;/long_name&gt; &lt;short_name&gt;NY&lt;/short_name&gt; &lt;type&gt;administrative_area_level_1&lt;/type&gt; &lt;type&gt;political&lt;/type&gt; &lt;/address_component&gt; &lt;address_component&gt; &lt;long_name&gt;United States&lt;/long_name&gt; &lt;short_name&gt;US&lt;/short_name&gt; &lt;type&gt;country&lt;/type&gt; &lt;type&gt;political&lt;/type&gt; &lt;/address_component&gt; &lt;address_component&gt; &lt;long_name&gt;11211&lt;/long_name&gt; &lt;short_name&gt;11211&lt;/short_name&gt; &lt;type&gt;postal_code&lt;/type&gt; &lt;/address_component&gt; &lt;geometry&gt; &lt;location&gt; &lt;lat&gt;40.7142330&lt;/lat&gt; &lt;lng&gt;-73.9612910&lt;/lng&gt; &lt;/location&gt; &lt;location_type&gt;ROOFTOP&lt;/location_type&gt; &lt;viewport&gt; &lt;southwest&gt; &lt;lat&gt;40.7110854&lt;/lat&gt; &lt;lng&gt;-73.9644386&lt;/lng&gt; &lt;/southwest&gt; &lt;northeast&gt; &lt;lat&gt;40.7173806&lt;/lat&gt; &lt;lng&gt;-73.9581434&lt;/lng&gt; &lt;/northeast&gt; &lt;/viewport&gt; &lt;/geometry&gt; &lt;/result&gt; &lt;/GeocodeResponse&gt; </code></pre> <p>However be aware that the <a href="http://code.google.com/apis/maps/terms.html" rel="noreferrer">Google Maps API Terms of Use</a> seem to <a href="http://code.google.com/apis/maps/terms.html#section_10_12" rel="noreferrer">prohibit the storage of the results</a>, unless the store acts as a cache for data that will used in Google Maps. You may want to get in touch with Google and enquire on the <a href="http://www.google.com/enterprise/earthmaps/maps.html" rel="noreferrer">Google Maps API Premier</a> to have more flexible terms of use for your geocoding requirements. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload