Calculating gps coordinate radius

左心房为你撑大大i 提交于 2019-12-02 04:04:59

问题


I have this coordinates:

lat: 45.815005 lon: 15.978501

and i have mysql table with lat and lon coordinates stored as float

what i need is to get all coordinate in 500 meters around me?

so basicly my problem is to add X meters to my coordinate location

Also: how can i separate coordinate 45.815005 (45 | 81 | 50 | 05 ???) so i can store them in mysql using indexes for quicker search?


回答1:


MySQL supports a spatial extension (quoting) :

MySQL supports spatial extensions to enable the generation, storage, and analysis of geographic features.

Using those, instead of storing coordinates your own way, might help, when it comes to geographical manipulations.



来源:https://stackoverflow.com/questions/5390497/calculating-gps-coordinate-radius

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!