獲取給定郵政編碼的位置的最佳方式是什麼?它將對美國以外的國家工作/加拿大.ThanksiOS從郵政編碼查找位置(經度,緯度)
回答
使用谷歌API大地定位(嘗試一下在google.com/maps):
輸入用於例如瑞士郵政編碼: CH-9014
或法式之一: FR-34000
或德語: 去12101
或美國: 我們-90210
或加拿大: CA-J5Z 1A1
或中國: CN-100000nm
爲example:
產量
{
"status": "OK",
"results": [ {
"types": [ "postal_code" ],
"formatted_address": "9014 St Gallen, Switzerland",
"address_components": [ {
"long_name": "9014",
"short_name": "9014",
"types": [ "postal_code" ]
}, {
"long_name": "St Gallen",
"short_name": "St Gallen",
"types": [ "locality", "political" ]
}, {
"long_name": "Sankt Gallen",
"short_name": "SG",
"types": [ "administrative_area_level_1", "political" ]
}, {
"long_name": "Switzerland",
"short_name": "CH",
"types": [ "country", "political" ]
} ],
"geometry": {
"location": {
"lat": 47.4082855,
"lng": 9.3323890
},
"location_type": "APPROXIMATE",
"viewport": {
"southwest": {
"lat": 47.3991076,
"lng": 9.3180504
},
"northeast": {
"lat": 47.4199564,
"lng": 9.3543340
}
},
"bounds": {
"southwest": {
"lat": 47.3991076,
"lng": 9.3180504
},
"northeast": {
"lat": 47.4199564,
"lng": 9.3543340
}
}
}
} ]
}
所以瑞士郵政編碼9014對應APPX。到此位置:
"lat": 47.4082855,
"lng": 9.3323890
見的大地定位API在這裏我的答案:
How to get GLatLng object from address string in advance in google maps?
它是免費的嗎? – 2013-10-07 06:41:47
@Jagdish:我的代碼?是。用於商業Intranet目的的google-api:沒有。 – 2014-03-19 15:10:09
GeoNames提供了大量的各種郵編地理編碼服務,包括搜索特定郵政編碼的位置。他們支持一些國家。
你很可能是最感興趣的Placename Lookup for postalcode service
谷歌的API中附帶了一些非常討厭的限制。根據@Claus Broch的建議,最好使用像GeoNames這樣的開放源代碼。
我在添加這個答案的同時也注意到MapQuest最近把一個API放到了OpenStreetMap數據中。它沒有(據我所知)郵政編碼搜索,但位置名稱,方向,高度等都可以自由查詢。我最近發現它,我打算儘快用Google地圖API替換我的電話。
- 1. 從經緯度查找郵政編碼
- 2. 經度/緯度到郵政編碼?
- 3. 從經緯度獲取郵政編碼
- 4. Perl得到的位置(經度+緯度),加上郵政編碼
- 5. 通過Java中的郵政編碼查找緯度和經度
- 6. android從印度經緯度獲得印度的郵政編碼
- 7. 緯度和經度可以找到郵政編碼?
- 8. 查找最接近的郵政編碼,經緯度在MySQL
- 9. 如何查找經緯度對應的郵政編碼
- 10. 英國郵政編碼的地理編碼經度和緯度?
- 11. 從經度,緯度獲取郵政編碼?
- 12. 從經度/緯度獲取郵政編碼
- 13. 從緯度和經度獲取一個郵政編碼
- 14. 從經度和緯度座標獲取郵政編碼
- 15. 從javascript中的緯度和經度獲取郵政編碼
- 16. 從郵政編碼獲取經度/緯度
- 17. 谷歌地圖從郵政編碼獲取經度和緯度
- 18. 從經度和緯度沒有得到郵政編碼
- 19. 如何查找英國的緯度和經度的郵政編碼
- 20. 尋找基於郵政編碼的經緯度
- 21. 谷歌地圖:從地理編碼的郵政編碼獲取緯度/經度
- 22. 如何使用郵政編碼/郵政編碼在iOs中使用CLGeoCoder獲取緯度經度?
- 23. 使用PHP獲取郵政編碼的經度和緯度
- 24. SimpleGeo是否提供郵政編碼給緯度/經度映射?
- 25. 得到緯度和經度使用郵政編碼
- 26. 如何獲取郵政編碼的經度和緯度?
- 27. 獲取緯度/經度附近的郵政編碼列表
- 28. 基於郵政編碼的經度和緯度
- 29. 從經緯度獲取郵政編碼+4
- 30. 如何從經緯度獲取英國郵政編碼?
您可以通過提供位置 – Aditya 2011-01-10 11:17:54
的地址,以供將來參考認罪找到位置參考這裏: - http://stackoverflow.com/questions/9606031/ios-mkmapview-place-annotation-by -using-address-instead-lat-long – StuartM 2014-05-03 12:34:58