计算范围内的邮编 [英] Calculate zipcodes in range

查看:112
本文介绍了计算范围内的邮编的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个包含不同商店的表格,其中也包含属于商店的邮政编码。

p>

是否有可能让邮政编码在我们说的用户输入的zip的5公里范围内?



因此,我可以查询数据库并查找用户附近的所有商店。



我可以使用Google地图吗?我是否应该掌握所有邮编(单国)及其坐标的预先计算清单?任何其他建议?

解决方案

您需要每个邮编的纬度和经度,然后使用 Haversine Formula 获得近似距离。


I have a website where users start by entering their zipcode.

I have a table with different shops which also contain the zip codes belonging to the shops.

Is it possible to get the zip codes within let's say a 5 km radius of the zip entered by the user?

So I can query the database and find all the shops near the user.

Can I use Google Maps for this? Should I get my hands on a pre-computed list of all zipcodes (single country) and their coordinates? Any other suggestions?

解决方案

You'll need that latitude and longitude of each zipcode, and then use the Haversine Formula to get the approximate distance.

这篇关于计算范围内的邮编的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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