AND经度< = $ HighLongitude 然后我使用纬度和经度计算实际距离 每个zip返回。 这很好用,可以节省很多周期。这种技术的缺点是 无法按距离排序。有人可以建议一个简单的方法来计算和查询中的ORDER BY距离吗? 谢谢!I have successfully converted the ASP code included in the following articleto PHP: http://www.4guysfromrolla.com/webtech/040100-1.shtmlAs described the high and low latitudes and longitudes are pre-calculatedand passed to the query.SELECT *FROM LocationsWHERE Latitude <= $HighLatitudeAND Latitude >= $LowLatitudeAND Longitude >= $LowLongitudeAND Longitude <= $HighLongitudeI then calculate the actual distance using the latitude and longitude foreach zip returned.This works great and saves lots of cycles. The downside to this technique isthe inability to sort by distance. Can someone suggest a simple way tocalculate and ORDER BY distance within the query?Thanks!推荐答案 HighLatitude 和纬度> =HighLatitudeAND Latitude >= LowLatitude 和经度> ; =LowLatitudeAND Longitude >= LowLongitude 和经度< =LowLongitudeAND Longitude <= 这篇关于按邮政编码距离排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-04 12:29