2016-07-26 4 views
-1

Google지도 API를 사용하여 경계 및 좌표를 가져옵니다.gmap api geocode 우편 번호 사우디 아라비아가 예상대로 작동하지 않습니다.

사우디 아라비아 (SA) 지역의 주소를 지오 코딩, 사우디 아라비아의 우편 번호 (SA)는 지오 코더의 결과를 지오 코딩 할 때부터 2517에 헤이그, 네덜란드

{ 
    "results" : [ 
     { 
     "address_components" : [ 
      { 
       "long_name" : "2517", 
       "short_name" : "2517", 
       "types" : [ "postal_code", "postal_code_prefix" ] 
      }, 
      { 
       "long_name" : "The Hague", 
       "short_name" : "The Hague", 
       "types" : [ "locality", "political" ] 
      }, 
      { 
       "long_name" : "The Hague", 
       "short_name" : "The Hague", 
       "types" : [ "administrative_area_level_2", "political" ] 
      }, 
      { 
       "long_name" : "South Holland", 
       "short_name" : "ZH", 
       "types" : [ "administrative_area_level_1", "political" ] 
      }, 
      { 
       "long_name" : "Netherlands", 
       "short_name" : "NL", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "2517 The Hague, Netherlands", 
     "geometry" : { 
      "bounds" : { 
       "northeast" : { 
        "lat" : 52.0958783, 
        "lng" : 4.3007563 
       }, 
       "southwest" : { 
        "lat" : 52.0773935, 
        "lng" : 4.2732776 
       } 
      }, 
      "location" : { 
       "lat" : 52.0847639, 
       "lng" : 4.2801843 
      }, 
      "location_type" : "APPROXIMATE", 
      "viewport" : { 
       "northeast" : { 
        "lat" : 52.0958783, 
        "lng" : 4.3007563 
       }, 
       "southwest" : { 
        "lat" : 52.0773935, 
        "lng" : 4.2732776 
       } 
      } 
     }, 
     "place_id" : "ChIJI9DHzc6wxUcR1s1th0GbWgQ", 
     "types" : [ "postal_code", "postal_code_prefix" ] 
     }, 
     { 
     "address_components" : [ 
      { 
       "long_name" : "2517", 
       "short_name" : "2517", 
       "types" : [ "postal_code" ] 
      }, 
      { 
       "long_name" : "Russell Vale", 
       "short_name" : "Russell Vale", 
       "types" : [ "locality", "political" ] 
      }, 
      { 
       "long_name" : "Wollongong City Council", 
       "short_name" : "Wollongong", 
       "types" : [ "administrative_area_level_2", "political" ] 
      }, 
      { 
       "long_name" : "New South Wales", 
       "short_name" : "NSW", 
       "types" : [ "administrative_area_level_1", "political" ] 
      }, 
      { 
       "long_name" : "Australia", 
       "short_name" : "AU", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "Russell Vale NSW 2517, Australia", 
     "geometry" : { 
      "bounds" : { 
       "northeast" : { 
        "lat" : -34.3338503, 
        "lng" : 150.9245951 
       }, 
       "southwest" : { 
        "lat" : -34.3654418, 
        "lng" : 150.8740632 
       } 
      }, 
      "location" : { 
       "lat" : -34.3454996, 
       "lng" : 150.9016476 
      }, 
      "location_type" : "APPROXIMATE", 
      "viewport" : { 
       "northeast" : { 
        "lat" : -34.3338503, 
        "lng" : 150.9245951 
       }, 
       "southwest" : { 
        "lat" : -34.3654418, 
        "lng" : 150.8740632 
       } 
      } 
     }, 
     "place_id" : "ChIJSaEBIk8eE2sRQIa6P2t9ARw", 
     "postcode_localities" : [ "Russell Vale", "Woonona" ], 
     "types" : [ "postal_code" ] 
     } 
    ], 
    "status" : "OK" 
} 

를 참조 주소를 가지고 있지만 결과는 사우디 아라비아와 관련이 없었으며, 국가 api에 제한이 추가되었습니다. 그러나이 결과 부분 결과 값 결과가 정확하지 않습니다 의미 진정한, 가지고 있으며 결과는 사우디 아라비아 위치

https://maps.googleapis.com/maps/api/geocode/json?address=2517&components=country:SA

{ 
    "results" : [ 
     { 
     "address_components" : [ 
      { 
       "long_name" : "Saudi Arabia", 
       "short_name" : "SA", 
       "types" : [ "country", "political" ] 
      } 
     ], 
     "formatted_address" : "Saudi Arabia", 
     "geometry" : { 
      "bounds" : { 
       "northeast" : { 
        "lat" : 32.1542839, 
        "lng" : 55.6666999 
       }, 
       "southwest" : { 
        "lat" : 16.379528, 
        "lng" : 34.5489978 
       } 
      }, 
      "location" : { 
       "lat" : 23.885942, 
       "lng" : 45.079162 
      }, 
      "location_type" : "APPROXIMATE", 
      "viewport" : { 
       "northeast" : { 
        "lat" : 32.1542839, 
        "lng" : 55.6666999 
       }, 
       "southwest" : { 
        "lat" : 16.379528, 
        "lng" : 34.5489978 
       } 
      } 
     }, 
     "partial_match" : true, 
     "place_id" : "ChIJQSqV5z-z5xURm7YawktQYFk", 
     "types" : [ "country", "political" ] 
     } 
    ], 
    "status" : "OK" 
} 

의 기본 값을 가지고 있지만 때 주소 거리/지역에 지리 코드가 추가되었습니다. https://maps.googleapis.com/maps/api/geocode/json?address=2517+Ar+Riyadh&components=country:SA

Gmap API를 강제로 지오 코드로 사용할 수있는 방법이 있습니까? 사우디 아라비아 국가의 경우 우편 번호가 유일한 경우 결과가 정확한 좌표와 경계입니까?

+1

지오 코드 데이터베이스에 2517이 사우디 아라비아의 유효한 우편 번호/우편 번호로 포함되어 있지 않은 것처럼 보입니다. 유효한 우편 번호입니까 (충분한 자릿수가없는 것처럼 보입니까)? 그렇다면 Google지도 "mapmaker"로 이동하여 추가해야 할 수도 있습니다. (참고 : 귀하가 게시 한 [ "working example"] (https://maps.googleapis.com/maps/api/geocode/json?address=2517+Ar+Riyadh&components=country:SA) 우편 번호 55425가 반환됩니다. – geocodezip

+0

Thanks 아래 링크에서 사우디 아라비아 우편 번호를 찾으십시오. http://life-in-saudiarabia.blogspot.in/2015/09/zip-codepostal-code-of-major-cities-of.html#.V5g_BvnnZBc이 페이지에 나열된 Zipcode 중 하나를 사용하는 동안 Google 지오 코드가 예상과 다릅니다. – Zlahc

답변

1

우편 번호 범위가 사우디 아라비아에게는 좋지 않은 것처럼 보입니다.

component filtering을 사용하여 우편 번호를 검색 할 수 있지만 누락 된 우편 번호는 ZERO_RESULTS가되는 경우가 많습니다.

https://maps.googleapis.com/maps/api/geocode/json?components=postal_code%3A12631%7Ccountry%3ASA

는 우편 번호를 반환 예를 들어

,하지만

https://maps.googleapis.com/maps/api/geocode/json?components=postal_code%3A31433%7Ccountry%3ASA

반환 ZERO_RESULTS.

누락 된 우편 번호는 maps.google.com의 오른쪽 하단에있는 '의견 보내기'링크를 사용할 수 있습니다.

https://support.google.com/maps/answer/162873

는 희망이 도움이!