Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The functionality you're describing is called "Reverse-Geocoding" - taking a lat/lng coordinate, and returning the name of the nearest place to that location. (Geocoding is the opposite - providing a placename in order to retrieve the associated lat/lng coordinates).</p> <p>You can certainly build a reverse-geocoding service that uses SQL Server as the backend database, but there's nothing built-in to provide such functionality.</p> <p>If you simply want to reverse-geocode a set of existing data, rather than create this functionality in SQL Server, you might find it easier to use an existing webservice. For example, the geonames findNearbyPlaceName has a REST interface that you access via the following URL template:</p> <p><a href="http://api.geonames.org/findNearbyPlaceName?lat=52.62&amp;lng=1.28&amp;username=demo" rel="nofollow">http://api.geonames.org/findNearbyPlaceName?lat=52.62&amp;lng=1.28&amp;username=demo</a></p> <p>This example returns information about the nearest known entity to the requested lat/lng coordinates (52.62,1.28) from the geonames database, as follows:</p> <pre><code>&lt;geonames&gt; &lt;geoname&gt; &lt;toponymName&gt;Norwich&lt;/toponymName&gt; &lt;name&gt;Norwich&lt;/name&gt; &lt;lat&gt;52.62783&lt;/lat&gt; &lt;lng&gt;1.29834&lt;/lng&gt; &lt;geonameId&gt;2641181&lt;/geonameId&gt; &lt;countryCode&gt;GB&lt;/countryCode&gt; &lt;countryName&gt;United Kingdom&lt;/countryName&gt; &lt;fcl&gt;P&lt;/fcl&gt; &lt;fcode&gt;PPLA2&lt;/fcode&gt; &lt;distance&gt;1.51318&lt;/distance&gt; &lt;/geoname&gt; &lt;/geonames&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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