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是可选的,但结果很可能会更好,如果它们被设置为明智值来反映用户的位置。