摘要: 指定一个经纬度,给定一个范围值(单位:千米),查出在经纬度周围这个范围内的数据。经度:113.914619纬度:22.50128范围:2kmlongitude为数据表经度字段latitude为数据表纬度字段SQL在mysql下测试通过,其他数据库可能需要修改SQL语句如下:Java代码select*fromlocationwheresqrt((((113.914619-longitude)*PI()*12656*cos(((22.50128+latitude)/2)*PI()/180)/180)*((113.914619-longitude)*PI()*12656*cos(((22.50128 阅读全文
posted @ 2013-05-10 14:27 王者杂货铺 阅读(445) 评论(0) 推荐(0) 编辑