list 我在哪里可以找到所有英国 _full_ 邮政编码的列表,包括街道名称及其精确坐标?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1538743/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where can I find a list of all UK _full_ postcodes including street name and their precise coordinates?
提问by Doogal
Where can I find a list of all UK fullpostcodes including street name and their precise coordinates? They should be not like AB1, AB23 etc but AB1 2AA, AB23 5ZZ etc.
我在哪里可以找到所有英国完整邮政编码的列表,包括街道名称及其精确坐标?它们应该不像 AB1、AB23 等,而是 AB1 2AA、AB23 5ZZ 等。
Preferably for free :)
最好是免费的:)
Thanks
谢谢
回答by Doogal
You can now get postcode data for free from the Ordnance Survey https://www.ordnancesurvey.co.uk/business-and-government/products/code-point-open.htmlThis doesn't come with street names though
您现在可以从军械调查https://www.ordnancesurvey.co.uk/business-and-government/products/code-point-open.html免费获取邮政编码数据, 但这并不附带街道名称
If you want the data converted to lat/long then you can grab it from my site http://www.doogal.co.uk/UKPostcodes.php
如果您希望将数据转换为经纬度,那么您可以从我的网站http://www.doogal.co.uk/UKPostcodes.php获取它
回答by 03Usr
You can download the entire GB postcode data complete with Lat and Long values from here completely free:
您可以从这里完全免费下载完整的 GB 邮政编码数据以及 Lat 和 Long 值:
http://download.geonames.org/export/dump/
http://download.geonames.org/export/dump/
Simply scroll down to GB.zip There are also other countries postcode info, I have used Germany and Poland data and they are also OK.
只需向下滚动到 GB.zip 还有其他国家的邮政编码信息,我使用了德国和波兰的数据,它们也可以。
回答by macycron
Also try here for UK. http://www.freemaptools.com/download-uk-postcode-lat-lng.htm
也可以在这里尝试英国。http://www.freemaptools.com/download-uk-postcode-lat-lng.htm
回答by Murat Sert
As part of a freelance project in PyQt I've written an algorithm to get user input of postcode and return the street name for it. For anyone who's looking for an alternative to commercial systems, open-source and straightforward approach to this issue can use it freely.
作为 PyQt 中一个自由职业者项目的一部分,我编写了一个算法来获取用户输入的邮政编码并为其返回街道名称。对于任何正在寻找商业系统替代品的人来说,这个问题的开源和直接方法都可以自由使用。
I've written it in Python2.7 but can easily be replicated in the newer versions or in other languages.
我是用 Python2.7 编写的,但可以很容易地复制到较新的版本或其他语言中。
import urllib
from urllib2 import urlopen
import json
try:
google_map_key = raw_input("please enter your google maps api key: ")
postcode = raw_input("Please enter a UK Postcode: ")
postcode = postcode.replace(" ", "")
url = "https://maps.googleapis.com/maps/api/geocode/json?address="+postcode+"&key="+google_map_key
response = urlopen(url)
json_obj = json.load(response)
counter = 0
if json_obj['status'] == 'OK':
for i in json_obj['results']:
for x in i['address_components']:
counter += 1
if counter == 2:
print ("Long street name: " + x['long_name'])
break
else:
print("No results found! Please enter a valid postcode or check your internet connection and google api key")
except:
print("Unhandle exception")
回答by Amjith
Here is the list in csv
这是csv中的列表
https://raw.githubusercontent.com/Gibbs/uk-postcodes/master/postcodes.csv
https://raw.githubusercontent.com/Gibbs/uk-postcodes/master/postcodes.csv
More details : https://github.com/Gibbs/uk-postcodes
回答by Steven Robbins
Unfortunately this is something you have to pay for, and it's not particularly cheap! There's an online petitionto get this information freed if you are interested.
不幸的是,这是您必须支付的费用,而且并不是特别便宜!如果您有兴趣,有一个在线请愿书可以释放这些信息。
Commercial wise, just do a Google for uk postcode database and take your pick, they are all much of a muchness.
从商业角度来看,只需为英国邮政编码数据库做一个谷歌并选择,它们都非常重要。
回答by Andrew
The Royal Mail is the supplier of the 'official' Post Code database for the UK - they own the postcodes and postcode to GIS mapping. It's copyrighted and has some significant license fees.
皇家邮政是英国“官方”邮政编码数据库的供应商——他们拥有邮政编码和邮政编码到 GIS 制图。它受版权保护,并有一些重要的许可费用。
Postzon is the product they sell to link the postcodes to the GIS co-ordinates.
Postzon 是他们销售的产品,用于将邮政编码链接到 GIS 坐标。
There have been third party providers from outside europe who released details in the past for a fraction of the costs, but it's a very grey area, and you are then in consult a lawyer territory.
过去曾有来自欧洲以外的第三方提供商以一小部分成本发布了详细信息,但这是一个非常灰色的区域,然后您需要咨询律师领域。
回答by Keith MacDonald
The OS "free" version is useful, but it does have a few limitations, for example no data for Northern Ireland, the Isle of Man, Guernsey or Jersey.
操作系统“免费”版本很有用,但它确实有一些限制,例如没有北爱尔兰、马恩岛、根西岛或泽西岛的数据。
I vote for Doogal's version with the extra latitude and longitude data, which is more useful for geo-mapping like OpenLayer.
我投票支持 Doogal 的版本,它带有额外的纬度和经度数据,这对于像 OpenLayer 这样的地理映射更有用。