2017-06-16 8 views
0

となり、私はGoogleが(私のGoogleのAPIキー付き)以下の要求にマップのAPIを配置呼んでいる:Googleのジオロケーションアドレス検索は、正確なpartial_match =真

https://maps.googleapis.com/maps/api/geocode/json?address=32/36+Nagle+St,+Liverpool+NSW&components=postal_code:2170|country:AU&key= {あなたのキー}

そしてそれは、次のJSONを返す:アドレスが同じ結果の「部分一致」のアドレスとして渡されたときに

{ 
    "results" : [ 
     { 
     "address_components" : [ 
      { 
       "long_name" : "32", 
       "short_name" : "32", 
       "types" : [ "subpremise" ] 
      }, 
      { 
       "long_name" : "36", 
       "short_name" : "36", 
       "types" : [ "street_number" ] 
      }, 
      { 
       "long_name" : "Nagle Street", 
       "short_name" : "Nagle St", 
       "types" : [ "route" ] 
      }, 
      { 
       "long_name" : "Liverpool", 
       "short_name" : "Liverpool", 
       "types" : [ "locality", "political" ] 
      }, 
      { 
       "long_name" : "Liverpool City Council", 
       "short_name" : "Liverpool", 
       "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" ] 
      }, 
      { 
       "long_name" : "2170", 
       "short_name" : "2170", 
       "types" : [ "postal_code" ] 
      } 
     ], 
     "formatted_address" : "32/36 Nagle St, Liverpool NSW 2170, Australia", 
     "geometry" : { 
      "location" : { 
       "lat" : -33.92853530000001, 
       "lng" : 150.9219302 
      }, 
      "location_type" : "ROOFTOP", 
      "viewport" : { 
       "northeast" : { 
        "lat" : -33.92718631970851, 
        "lng" : 150.9232791802915 
       }, 
       "southwest" : { 
        "lat" : -33.92988428029151, 
        "lng" : 150.9205812197085 
       } 
      } 
     }, 
     "partial_match" : true, 
     "place_id" : "Ei0zMi8zNiBOYWdsZSBTdCwgTGl2ZXJwb29sIE5TVyAyMTcwLCBBdXN0cmFsaWE", 
     "types" : [ "subpremise" ] 
     } 
    ], 
    "status" : "OK" 
} 

はなぜ結果がここにpartial_match =真を持っているのですか?

"partial_match" : true 

答えて

0

結果が補間されたため、Googleデータベースの機能ではなく、補間に基づいて位置が計算されたと考えられます。

レスポンスの場所IDを確認してください。

Ei0zMi8zNiBOYWdsZSBTdCwgTGl2ZXJwb29sIE5TVyAyMTcwLCBBdXN0cmFsaWE

一般的に、これらの長い場所IDが補間に対応し、その結果を推測して、私の仮定は、APIは、このような状況で部分一致フラグを設定することです。

Googleデータベースにある機能には通常、場所IDが短くなっています。例えば。 ChIJARdFFWLRhIARK6RIUxEbJ30

https://developers.google.com/places/place-id#id-overview

関連する問題