【问题标题】:Inaccurate search result from Google place API (Geocoding)来自 Google place API(地理编码)的搜索结果不准确
【发布时间】:2016-11-10 18:05:13
【问题描述】:

我正在尝试对菲律宾的一些地址进行地理编码,但是当我通过 Google API 进行搜索时,我得到的结果非常不准确(距离我正在寻找的点 10 公里,而 maps.google.com 提供了更好的结果大约有几百米的误差)。

在这里阅读了其他帖子(并测试了 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

有人知道如何提高精度吗?

【问题讨论】:

    标签: python google-maps google-maps-api-3 google-places-api google-geocoding-api


    【解决方案1】:

    您是否尝试过使用 Web 服务 api?如果 Web 服务 api 更精确,您可以在应用程序中使用 json-parser。

    https://developers.google.com/places/web-service/search

    【讨论】:

      【解决方案2】:

      看起来你正在使用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 是可选的,但如果将它们设置为可反映用户所在位置的合理值,结果可能会更好。

      【讨论】:

        猜你喜欢
        • 2020-03-05
        • 2012-03-06
        • 2016-03-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多