从一组坐标中找到最接近的坐标 [英] Find the closest coordinate from a set of coordinates
本文介绍了从一组坐标中找到最接近的坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我大约有1000套地理坐标(纬度,经度)。
给定一个坐标,我想从该坐标集中找到最接近的坐标。我的方法是测量距离,但每秒处理数百个请求对于执行所有数学操作的服务器可能有点困难。
I have about 1000 set of geographical coordinates (lat, long). Given one coordinate i want to find the closest one from that set. My approach was to measure the distance but on hundreds requests per second can be a little rough to the server doing all that math.
什么是最佳的最佳解决方案?
What is the best optimized solution for this?
谢谢
推荐答案
您将要使用最近的邻居算法 。
这篇关于从一组坐标中找到最接近的坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文