如何从英国邮政编码获取地理位置

Pet*_*art 3 php geolocation postal-code google-maps-api-3

我目前有一个PHP脚本,允许用户输入英国邮政编码.

我想知道是否有办法从他们输入的邮政编码中获取地理位置.(通过谷歌的API或什么?)

我尝试了http://code.google.com/apis/maps/documentation/geocoding/index.html,但它需要一个完整的地址,而我只有一个邮政编码.

帮助将不胜感激,谢谢:)彼得

Tom*_*omi 5

这是一个可下载的数据库,适用于所有具有纬度和经度的英国邮政编码.

http://wikileaks.org/wiki/UK_government_database_of_all_1,841,177_post_codes_together_with_precise_geographic_coordinates_and_other_information,_8_Jul_2009

以下是使用Google Map API对英国邮政编码进行地理编码的分步教程

http://www.tomanthony.co.uk/blog/geocoding-uk-postcodes-with-google-map-api/

  • 而不是使用wikileaks(好像它是非法的和"在柜台下")为什么不简单地使用Ordnance Surveys Open CodePoint数据集 - https://www.ordnancesurvey.co.uk/oswebsite/products/code-point -open/index.html - 它比2009年的wikileaks更新 (3认同)

Mar*_*rkG 5

现在有一个免费的英国政府替代这里列出的其他选项.转到http://postcodes.io/查看API和示例的详细信息