查找位于指定距离之间的用户(使用用户的邮政编码)

Zee*_*ang 3 php mysql apache-flex actionscript

有没有办法使用邮政编码找到径向距离?

我的任务是搜索居住在指定距离内的所有用户.我知道用户的zipcodes.

例如,距离当前位置25英里的用户.

我有其他搜索类别,我正在使用mysql查询.我无法解决距离问题.

我的后端是在Flex中的php和前端.

对我来说最好的选择就是www.zip-codes.com/zip-code-radius-finder.asp.即,如果我能够在指定的径向距离内获得所有可用的邮政编码.所以我可以将此邮政编码与我数据库中的用户邮政编码进行比较.并选择匹配的.

这个你能帮我吗.Zeeshan

小智 8

我使用免费的Google Maps API完成了类似的工作 - 这可能足以满足您的需求

http://googlemapsapi.blogspot.com/2006/06/geocoding-at-last.html - 关于此主题的简短发布(自2006年起)

http://code.google.com/apis/maps/index.html - Google Maps API主页


Wri*_*ken 6

Postcodes don't map directly to a distance to each other. You will have to acquire postcode & lat/long data, look up the postcodes in there, and compare the distance between the lat/long coordinates. Depending on the locality free data may be available, but it's very common to buy such a table, or subscribe to a possibly paid webservice which does the translation of postcode to lat/long or neighboring postcodes for you.