开发者

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++.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜