Google maps Google Places不会返回半径范围内的位置

Google maps Google Places不会返回半径范围内的位置,google-maps,google-maps-api-3,google-places-api,Google Maps,Google Maps Api 3,Google Places Api,我目前正试图在特定地址查找公司的地点详细信息。为此,我使用geopy将地址编码为地理坐标。然后,我使用GooglePlacesAPI获取周围的位置,并使用它们的id通过GooglePlacesDetails获取详细信息(在下面找到我的代码) 问题是,我可以在谷歌地图上成功搜索到的公司没有在搜索结果中列出。一个问题可能是该公司“永久关闭”——但由于这是一个从Google Places返回的字段,而且我仍然可以通过Google地图上的websearch找到该公司,我认为这其实并不重要 你知道为什么我

我目前正试图在特定地址查找公司的地点详细信息。为此,我使用geopy将地址编码为地理坐标。然后,我使用GooglePlacesAPI获取周围的位置,并使用它们的id通过GooglePlacesDetails获取详细信息(在下面找到我的代码)

问题是,我可以在谷歌地图上成功搜索到的公司没有在搜索结果中列出。一个问题可能是该公司“永久关闭”——但由于这是一个从Google Places返回的字段,而且我仍然可以通过Google地图上的websearch找到该公司,我认为这其实并不重要

你知道为什么我的位置不在归国者之列吗

我的代码:

companies = [{'name': '"Bullermeck" Spielscheunen und Freizeitanlagen GmbH', 'address': 'Am Kirchplatz 6, 26441 Jever'}]
places = []
myfields = ['name', 'website', 'type', 'rating', 'review', 'url', 'formatted_address', 'permanently_closed']


for company in companies:
    placesForCompany = {'company': company['name'], 'original_address': company['address']}

    # Derive coordinates by converting the address with geopy
    location = geolocator.geocode(company['address'])
    coordinates = str(location.latitude) + ", " + str(location.longitude)
    placesForCompany['coordinates'] = coordinates

    # Search for places in a 500m radius - the radius is a bit higher because of the inaccuracy of geopy
    result = gmaps.places_nearby(location=coordinates, radius=500)

    # Gather the found places in this array
    placesForCompany['nearbyPlaces'] = []

    # Iterate all the found places
    for place in result['results']:
        # Use the place_id to get more information about the place from Google Place Details
        place_id = place['place_id']
        place_details = gmaps.place(place_id = place_id, fields = myfields, language='de')
        placesForCompany['nearbyPlaces'].append(place_details['result'])

    places.append(placesForCompany)
以下是我的谷歌地图搜索截图:
您似乎正在Kirchpl的地址搜索Bullermeck Spielscheunen and Freizeitantalagen。62641德国杰弗。如果您签入此项,您将获得位置id
ChIJZfmp\u meJtkcR1D7UdD4Sex4
。通过a检查此场所id,您将看到该场所的
业务状态
永久关闭
。请注意,根据此错误评论,标记为永久/临时关闭的位置不能通过搜索附近的位置进行搜索

正如您将注意到的,API仅返回具有“运营”业务状态的位置,因此您标记为永久关闭的业务不会在搜索结果中返回

注意:您需要在上面提供的示例请求上添加自己的API密钥


希望这有帮助

顺便说一句,如果我在谷歌地图网站上搜索“Bullermeck Spielscheune und Freizeitalagen GmbH”,我得到的唯一结果是Bullermeck Alfsee Spielscheune und Freizeitalagen GmbH,Barlager Str.1149597 Rieste,Germany,这与你在问题中所说的不符。如果您仍然需要帮助,请澄清。谢谢,这就成功了!附近的搜索请求没有返回歇业的地点,这是一个至关重要的信息。太好了!很高兴我能帮忙。