Monday, 15 February 2016

geometry - Find closest lat long to an input lat long (SQL Server 2008)


I have a point cloud in my database (SQL Server 2008 spatial). That is about 6 million records. There are 3 columns: id, value, geom. What is the optimal way of getting the 'value' at input lat long??


I am new to spatial queries in SQL Server 2008. Can someone post a simple example of finding the point in geom column, matching or closest from the input lat long?



Answer



What you are looking for is Nearest Neighbor Query. Look at the following links, I think you will find what you are looking for.


Nearest Neighbor Query



Nearest Neighbors


The nearest neighbor optimization in SQL Server Denali


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...