【问题标题】:Place from Google Maps missing in Google Places APIGoogle Places API 中缺少 Google Maps 中的地点
【发布时间】:2023-03-15 00:30:01
【问题描述】:

我一直在尝试在 Google Places API 中查找特定位置,但没有成功。当我在谷歌地图中输入“La Cucina Trattoria”时,我得到三个结果。但是,当我运行此查询时:

https://maps.googleapis.com/maps/api/place/autocomplete/json?key=API_KEY&input=la%20cucina%20trattoria

我只得到两个结果。所以我测试了更多具有类似效果的查询:

输入=la%20cucina%20trattoria%20gmbh - 没有结果

https://maps.googleapis.com/maps/api/place/search/json?key=API_KEY&location=48.139649,11.602685&rankby=distance&keyword=cucina - 结果中缺少位置(我已将其确切位置作为参数)

location=48.139649,11.602685&rankby=distance&keyword=Neherstraße%209 - 结果中缺少位置(但是,它返回的是来自同一条街道的结果)

我的客户随机命名了两个他知道的地方,但在 Google Places API 中都找不到。 Google Places API 和 Google Maps 是否有可能在两个不同的数据库上运行?或者这些地方可以隐藏在公共 API 中吗?

【问题讨论】:

    标签: google-maps google-places-api google-places


    【解决方案1】:

    我遇到过类似的问题,但通常更改查询会得到更好的结果。除了reporting it,还可以手动add a place

    POST https://maps.googleapis.com/maps/api/place/add/json?key=AddYourOwnKeyHere HTTP/1.1
    Host: maps.googleapis.com
    
    {
      "location": {
        "lat": -33.8669710,
        "lng": 151.1958750
      },
      "accuracy": 50,
      "name": "Google Shoes!",
      "phone_number": "(02) 9374 4000",
      "address": "48 Pirrama Road, Pyrmont, NSW 2009, Australia",
      "types": ["shoe_store"],
      "website": "http://www.google.com.au/",
      "language": "en-AU"
    }
    

    这应该允许您的应用程序立即看到该地点并可能将其添加到 Google 地图中。

    【讨论】:

    • 这并不能回答 Places API 是否使用与 maps.google.com 不同的数据库的问题
    • 根据他们的网页,它是:developers.google.com/places "Backed by the same database used by Google Maps..."
    • 嗯,这是一个答案,虽然它看起来并不令人满意
    • 手动添加地点并不能满足应用程序的需求,恐怕。它应该有谷歌地图拥有的每一个地方,并且添加每一个缺失的地方不是一种选择。如果它们具有相同的后端,我想知道是否有可能某些地方对于 Google Places API 是不可见的。
    • 我想知道是否有些地方实际上不是“地方”,而是谷歌地图系统中的一个不同实体,它们能够通过元数据和内部“用户实际可能是什么”在谷歌地图上返回在 Places API 中未使用的“for”算法。由于无法检查,这只是一个想法。
    【解决方案2】:

    我无法在 Places 中找到 La Cucina Trattoria,我尝试了多种不同的策略,包括文本搜索 (https://maps.googleapis.com/maps/api/place/textsearch/xml?query=italian restaurant on Neherstraße in munich&key=MYKEY)。我会在这里向 Place API 问题跟踪器报告它:https://code.google.com/p/gmaps-api-issues/issues/list?can=2&q=apitype:PlacesAPI%20type:Defect&sort=-stars&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Internal%20Stars

    查看大量现有错误列表,看看您是否可以将自己的名字添加到现有错误中并加快解决问题的速度。以下是一些类似的已确认错误:

    Some queries return no results when there should be many

    Bug: Sparse search results in germany

    Bug: Place details request returns wrong result

    【讨论】:

    • 感谢您的回复,我的客户提到的所有地方实际上都在德国,所以可以连接第二期。
    猜你喜欢
    • 2017-06-12
    • 2015-07-24
    • 1970-01-01
    • 2020-05-11
    • 1970-01-01
    • 1970-01-01
    • 2014-02-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多