城市和经纬度距离 [英] cities and distance by latitude-longitude

查看:69
本文介绍了城市和经纬度距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张桌子,上面有:

I have a table with:

城市 纬度 经度

我需要一个sql查询来知道所有城市都距离纽约100英里.

And I need a sql query to know all cities are 100 miles from new york.

推荐答案

也许可以帮助您:

Maybe this helps you: http://www.scribd.com/doc/2569355/Geo-Distance-Search-with-MySQL
It is a nice introduction. Or just google for mysql distance queries, you will find some tutorials.

如果有可能并希望更轻松,请切换到支持距离查询的 PostgreSQL 的盒子.

If you have the possibility and want to have it easier, switch to PostgreSQL which supports distance queries out of the box.

这篇关于城市和经纬度距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆