What is the most efficient way I can to get a list of locations sorted by proximity given a location?
For example,
Say I have a database of locations (latitude/longtitude), and a point. How can I grab the top 25 nearest locations from the database of locations?
Is there too a library, or a resource I can read up on various geospatial operations like开发者_如何学JAVA above? Thanks!
What you want to do sounds like a nearest neighbour search.
K-d trees are an efficient data structure to achieve this.
The CGAL library has spatial searching functions if you're looking for a library for C++.
精彩评论