geopython / geopython-workshop

The Doing Geospatial in Python Workshop (mainly provided at FOSS4G events)
https://geopython.github.io/geopython-workshop
Other
54 stars 22 forks source link

Section 10 Remote Data fixes : timeouts on WFS and localize #160

Closed justb4 closed 1 month ago

justb4 commented 1 month ago

NOTE "ahocevar WFS" is now up again and used in OpenLayers examples, so is expected to be available at least for next workshop.

Using latest local build of Dockerfile (June 6, 2024). WFS https://ahocevar.com/geoserver/wfs? working for other examples.

See Cell 16:

from owslib.fes import PropertyIsLike
from owslib.etree import etree
wfs11 = WebFeatureService(url='https://ahocevar.com/geoserver/wfs?', version='1.1.0')

filter_ = PropertyIsLike(propertyname='NAME', literal='Bucharest', wildCard='*')
filterxml = etree.tostring(filter_.toXML()).decode('utf-8')
response = wfs11.getfeature(typename='ne:ne_10m_populated_places', filter=filterxml)
---------------------------------------------------------------------------
TimeoutError                              Traceback (most recent call last)
File /usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py:537, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
    536 try:
--> 537     response = conn.getresponse()
    538 except (BaseSSLError, OSError) as e:
.
.

In addition: localize WFS examples from RO/Bucharest to EE/Tartu.