开发者

Find top "n" nearby coordinates

开发者 https://www.devze.com 2022-12-27 06:40 出处:网络
I have a coordinate. I want to find the top \"n\" (n being a variable value) nearest coordinates out of several thousand rows stored on a MySQL database. I also want to be able to define maximum and m

I have a coordinate. I want to find the top "n" (n being a variable value) nearest coordinates out of several thousand rows stored on a MySQL database. I also want to be able to define maximum and minimum distances between the coordinate in question and the coordinates in the database.

How best am I to go about this? Would it be bonkers to use PHP as I understand the syntax much better than MySQL?

If I use a MySQL function, how do I move it between databases if I choose to switch servers? How is it stored?

Lastly, what is the most efficient method of getting through all these 开发者_JAVA百科coordinates accurately - the coordinates are all relatively close to one another?

Thanks for your time,

John.


It would be bonkers to do this in PHP, and not farm this off to MySQL. If you stick to double precision floating point numbers then you should have better precision than available accuracy (i.e. civilian GPS is accurate to at best about 5m, but your calculations will give a precision of a few centimetres)

0

精彩评论

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