ARiisgaard / Thesis

0 stars 0 forks source link

Geocoder: Service timed out #5

Open ARiisgaard opened 4 years ago

ARiisgaard commented 4 years ago
PS C:\Users\A-G-R> & C:/Users/A-G-R/.conda/envs/MakeCityWebsite/python.exe c:/Users/Public/Python/Git/Thesis/Thesis/Code/MakeCityWebsite.py     
Traceback (most recent call last):
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\urllib\request.py", line 1318, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\http\client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\http\client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\http\client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\http\client.py", line 1026, in _send_output
    self.send(msg)
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\http\client.py", line 964, in send
    self.connect()
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\http\client.py", line 1400, in connect
    server_hostname=server_hostname)
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\ssl.py", line 407, in wrap_socket
    _context=self, _session=session)
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\ssl.py", line 817, in __init__
    self.do_handshake()
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\ssl.py", line 1077, in do_handshake
    self._sslobj.do_handshake()
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\ssl.py", line 689, in do_handshake
    self._sslobj.do_handshake()
socket.timeout: _ssl.c:830: The handshake operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\site-packages\geopy\geocoders\base.py", line 355, in _call_geocoder
    page = requester(req, timeout=timeout, **kwargs)
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\urllib\request.py", line 526, in open
    response = self._open(req, data)
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\urllib\request.py", line 544, in _open
    '_open', req)
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\urllib\request.py", line 504, in _call_chain
    result = func(*args)
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\urllib\request.py", line 1361, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\urllib\request.py", line 1320, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error _ssl.c:830: The handshake operation timed out>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:/Users/Public/Python/Git/Thesis/Thesis/Code/MakeCityWebsite.py", line 64, in <module>
    location = geolocator.geocode(place)
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\site-packages\geopy\geocoders\osm.py", line 387, in geocode
    self._call_geocoder(url, timeout=timeout), exactly_one
  File "C:\Users\A-G-R\.conda\envs\MakeCityWebsite\lib\site-packages\geopy\geocoders\base.py", line 378, in _call_geocoder
    raise GeocoderTimedOut('Service timed out')
geopy.exc.GeocoderTimedOut: Service timed out
PS C:\Users\A-G-R>
ARiisgaard commented 4 years ago

Potential temp fixes, if the issue returns:

https://medium.com/@grasscall/geocodertimedout-a-real-pain-9ed621d076e0 https://gis.stackexchange.com/questions/173569/avoid-time-out-error-nominatim-geopy-open-street-maps