【发布时间】:2020-12-14 08:16:53
【问题描述】:
我正在使用 Nominatim 和 geoPy 进行反向地理编码。它确实有效,但有时会出现连接池错误。我该如何解决?
错误:geopy.exc.GeocoderUnavailable: HTTPSConnectionPool(host='nominatim.openstreetmap.org', port=443): Max retries exceeded with url: /reverse?lat=16.5268&lon=80.6477&format=json&accept-language=en&addressdetails=1 (Caused by ReadTimeoutError("HTTPSConnectionPool(host='nominatim.openstreetmap.org', port=443): Read timed out. (read timeout=1)",))
代码是:
geolocator = Nominatim(user_agent=HOST_NAME)
reverse = RateLimiter(geolocator.reverse, min_delay_seconds=1)
coord=str(lat)+","+str(lng)
location=reverse(coord,language='en',exactly_one=True)
【问题讨论】:
标签: python-3.6 connection-pooling reverse-geocoding nominatim