0

我想在菲律賓地址解析一些地址,但是當我通過Google API搜索時,我只會得到非常不準確的結果(距離我要找的點10kms而maps.google.com提供了更好的結果,幾百米誤差)。Google place API的不準確的搜索結果

在閱讀其他帖子(並測試Google Maps API和Google Places API)之後,似乎maps.google.com基於Google Place,因此應該是實施的選項......但是,我仍然根據我所尋找的地址獲取不是真正接近的地點列表。

我的電話是這樣的:

address="Balay Expo Centro Building, EDSA corner McArthur Avenue, Araneta Center, Cubao, Quezon City, Metro Manila, Philippines" 
google_places = GooglePlaces(API_KEY) 
query_result = google_places.nearby_search(
    location = address, 
    radius=5) 

for place in query_result.places: 
    print place.name 
    print place.geo_location 

有誰知道如何提高精度?

回答

0

看起來你正在使用Nearby Search時,你應該使用Text Search。我在此鏈接Places API Web服務指南,因爲它解釋了這兩種搜索之間的區別。

既然你似乎可以用python-google-places,這是怎麼了(我覺得)它的工作原理:

address = "Balay Expo Centro Building, EDSA corner McArthur Avenue, Araneta Center, Cubao" 
user_location = "14.617766,121.057154" # Cubao 
google_places = GooglePlaces(API_KEY) 
query_result = googlemaps.places(
    query = address, 
    lat_lng = user_location, 
    radius=500) 

其實,lat_lngradius是可選的,但結果很可能會更好,如果它們被設置爲明智值來反映用戶的位置。