从邮政编码查找完整地址,解决方案是什么?
基本上我正在为我的网站制作申请表。我需要使用用户输入的邮政编码搜索完整地址,并希望提供该邮政编码的结果供他们选择。我知道需要某种数据库,但我正在努力寻找这个数据库,并希望得到任何帮助。
Basically I am making an application form for my site. I need to search for a full address using the user input postcode and would like to offer the results of that postcode for them to choose. I am aware that a database of sorts will be required but I am struggling to source this and would appreciate any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
在英国,您可以使用 192.com 从任何邮政编码获取完整地址。
他们在 192.com 上有一个完全免费的数据库,
我不为他们或他们的任何广告商工作,但已使用该网站进行许多数据输入应用程序。
根据您正在搜索的邮政编码设置 URL 格式。即
“a1 1aa”将是 http://www.192.com/ places/a/a1-1/a1-1aa
这将列出邮政编码中的所有地址。
这是我写的课程,希望对您有所帮助:
如果代码有点乱,请自学程序员!
In the UK you can get a full address from any postcode using 192.com.
They have a completely free database available at 192.com
I do not work for them or any of their advertisers, but have used this site for many data entry applications.
Format the URL from the postcode you are searching. i.e.
'a1 1aa' would be http://www.192.com/places/a/a1-1/a1-1aa
This will then list all address in the postcode.
Here's the class I have written, hope it is of help:
Sorry if the code is a little messy, self taught programmer!
在荷兰,您可以通过邮政编码和门牌号来唯一标识地址。
并非所有国家/地区都有此属性,因此您的里程可能会有所不同。
但是,您可以这样做:
街道的邮政编码表看起来像这样:
数据库通常是从第三方购买的。
In NL, you can uniquely identify an address by its postcode and the housenumber.
Not all countries have this property, so your mileage may vary.
However you'd do something like this:
The table postcode to street looks something like:
The database is usually purchased from a third party.
我发现了这个(通过 http:// /ben-major.co.uk/2012/02/using-google-maps-to-lookup-uk-postcodes/),同时自己寻找答案。希望有帮助:
http://jsfiddle.net/rxFBj/3/
I found this (via http://ben-major.co.uk/2012/02/using-google-maps-to-lookup-uk-postcodes/) whilst searching for the answer to this myself. Hope it helps:
http://jsfiddle.net/rxFBj/3/
我看到您在英国,不幸的是,这意味着要花费大量金钱才能访问皇家邮政的 邮政编码地址文件 (PAF)。
I see you're in the UK, which unfortunately means forking out an obscene amount of money for access to the Royal Mail's Postcode Address File (PAF).
您可以使用 Google 地理定位 api 等网络服务。
You could use a web service like Googles geolocation api.
您是指类似以下的服务吗?
http://www.postcodeanywhere.co.uk/demos/address-finder.aspx
我只是建议这样做,因为我们在工作中使用它,它没有给我们带来任何问题,但我想还有很多其他同样好的选择。
不过,这是一项付费服务(我相信)。
Do you mean a service like the following?
http://www.postcodeanywhere.co.uk/demos/address-finder.aspx
I only suggest this as we use this at work and it hasn't given us any problems but I would imagine there are plenty of other equally as good options available.
This is a paid service though (I believe).
如果您想在地址表单中添加邮政编码查找解决方案,则需要购买付费服务才能访问皇家邮政的邮政编码地址文件。
Ideal Postcodes 为英国提供了这样的解决方案。您可以在此处查看演示:https://ideal-postcodes.co.uk/postcode -查找演示
If you want to add a postcode lookup solution to your address form, you'll need to procure a paid service to access Royal Mail's Postcode Address File.
Ideal Postcodes offers a solution like this for the UK. You can view a demo here: https://ideal-postcodes.co.uk/postcode-lookup-demo