推荐一个处理特定半径内位置的网络服务?
我们有一位客户希望在他们的网站上提供商店定位器。我被要求找到一个网络服务,它允许我们发送邮政编码作为请求,并让它返回 x 半径内的位置。我们发现了这个,但它是由一个人维护的,而且看起来更新或支持得不是很好。我们正在寻找商业化的东西,最好是每季度至少更新一次邮政编码数据库,并且具有文档齐全且具有 PHP 可访问性的 API。我不会说价格不是一个对象,但现在我们只想要一些想法,而我的谷歌搜索让我失败了。
我已经在网站管理员论坛上发布了此内容,但我想我也应该介绍一下我的基础并在这里发布。
We have a client that wants a store locator on their website. I've been asked to find a webservice that will allow us to send a zipcode as a request and have it return locations within x radius. We found this, but it's maintained by a single person, and doesn't look like it gets updated or supported very well. We're looking for something commercial, ideally that updates their zipcode database at least once per quarter, and that has a well-documented API with PHP accessibility. I won't say price isn't an object, but right now we just want some ideas, and my google-fu has failed me.
I've already posted this over on the webmasters forum, but thought I'd cover my bases and post here too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我重新调整了这个出色的脚本来克服同样的挑战。它是免费的,非常可靠,而且速度相对较快。
在我的脚本中,我将地址存储在数据库中。因此,我没有显示一个页面来输入地址,而是将它们作为字符串传递,然后让奇迹发生。
他在应用程序中说了这一点,但请确保如果您选择这条路线,您将获得自己的 Google 地图 API。跟他不行啊!
如果您想采用技术性较低的方法,这里有一个 MySQL 查询 你可以在你的位置上运行(你必须在你的数据库中添加纬度/经度或设置地理编码服务)来给你直线距离。
I've repurposed this outstanding script to conquor this same challenge. It's free, has been very reliable, and is relatively quick.
In my script, I have addresses stored in the DB. So rather than show a page to enter addresses, I simply pass them as a string and let the magic happen.
He says it in the app, but ensure that if you go this route you get your own Google Maps API. It won't work with his!
If you want to go a bit less technical approach, here's a MySQL query you could run on your locations (you'd have to add lat/long to your DB or setup a GEOCODING service) to give you distance as the crow flies.
谷歌地图也有一个地理编码器,它可以对特定地址进行地理编码。
它限制为 x 数量的请求,但如果您的网站很小并且您进行了缓存,那么这应该不是什么大问题。如果您付费,您可以获得更多请求。
它可以通过 javascript 或 PHP 访问(并且有几个预先编写的 PHP 模块)
链接在这里:
http://code.google.com/apis/maps/documentation /javascript/v2/services.html
(我在一家每天处理超过 800,000 个请求的公司工作,因此它稳定且快速:))
Google Maps has a geocoder as well and it geocodes to the specific address.
It's limited to x number of requests but that shouldn't be a big deal if your site is small and if you cache. You can get more requests if you pay.
It can be accessed via javascript or via PHP (and there are several prewritten PHP modules out there)
Link here:
http://code.google.com/apis/maps/documentation/javascript/v2/services.html
(I worked for a company that did upwards of 800,000 requests a day, so it's stable and fast :) )
PostcodeAnywhere 有一个商店定位器功能 - 我认为它是按使用付费的,但我以前使用过他们的其他产品,而且非常便宜。
http://www.postcodeanywhere.co.uk/store-locator-tool/
PostcodeAnywhere has a Store Locator feature - I think it's pay per use, but I've used their other products before and they're very cheap.
http://www.postcodeanywhere.co.uk/store-locator-tool/