2012-09-23 160 views
2

我目前使用Google Geocoder API確定我的網絡服務的位置數據。 獲取特定國家和城市的郵政編碼對我來說很重要,但看起來谷歌正在限制結果。Google Geocoder查找按國家和城市獲取郵政編碼

這裏的API調用:

http://maps.googleapis.com/maps/api/geocode/json?address=deutschland,+saarlouis&language=de&sensor=false

的結果是這樣的:

{ 
    "results" : [ 
     { 
     "address_components" : [ 
      { 
       "long_name" : "Saarlouis", 
       "short_name" : "Saarlouis", 
       "types" : [ "locality", "political" ] 
      }, 
      { 
       "long_name" : "Landkreis Saarlouis", 
       "short_name" : "Landkreis Saarlouis", 
       "types" : [ "administrative_area_level_3", "political" ] 
      }, 
      { 
       "long_name" : "Saarland", 
       "short_name" : "SL", 
       "types" : [ "administrative_area_level_1", "political" ] 
      }, 
      { 
       "long_name" : "Deutschland", 
       "short_name" : "DE", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "Saarlouis, Deutschland", 
     "geometry" : { 
      "bounds" : { 
       "northeast" : { 
        "lat" : 49.36187570, 
        "lng" : 6.815549499999999 
       }, 
       "southwest" : { 
        "lat" : 49.26046930, 
        "lng" : 6.67501510 
       } 
      }, 
      "location" : { 
       "lat" : 49.31346060, 
       "lng" : 6.752286499999999 
      }, 
      "location_type" : "APPROXIMATE", 
      "viewport" : { 
       "northeast" : { 
        "lat" : 49.36187570, 
        "lng" : 6.815549499999999 
       }, 
       "southwest" : { 
        "lat" : 49.26046930, 
        "lng" : 6.67501510 
       } 
      } 
     }, 
     "types" : [ "locality", "political" ] 
     } 
    ], 
    "status" : "OK" 
} 

THX的幫助。

Regards

+0

一種方法是https://github.com/Loceo/loceo-jquery-plugin – Gustav

回答

0

地理編碼不提供郵政編碼。 Goenames有一個數據庫Germany。其他國家也可用。

+0

我已經檢查過geonames.org,但免費地址識別API不如Google。檢索郵政編碼的方法很有意思。 – user1044195

相關問題