Skip to content

Commit 9dddeef

Browse files
authored
update wfs url in docs (wfs not available anymore) (#997)
* update wfs url in docs (wfs not available anymore) * add format check and pagination docs
1 parent cbc445b commit 9dddeef

File tree

1 file changed

+48
-26
lines changed

1 file changed

+48
-26
lines changed

docs/source/usage.rst

Lines changed: 48 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -83,52 +83,73 @@ WFS
8383
---
8484
Connect to a WFS and inspect its capabilities.
8585

86-
::
86+
.. code-block:: python
8787
8888
>>> from owslib.wfs import WebFeatureService
89-
>>> wfs11 = WebFeatureService(url='http://geoserv.weichand.de:8080/geoserver/wfs', version='1.1.0')
90-
>>> wfs11.identification.title
91-
'INSPIRE WFS 2.0 DemoServer Verwaltungsgrenzen Bayern
89+
>>> wfs20 = WebFeatureService(url='https://services.rce.geovoorziening.nl/dijken/wfs', version='2.0.0')
90+
>>> wfs20.identification.title
91+
'Landschapsatlas'
9292
93-
>>> [operation.name for operation in wfs11.operations]
94-
['GetCapabilities', 'DescribeFeatureType', 'GetFeature', 'GetGmlObject']
93+
>>> [operation.name for operation in wfs20.operations]
94+
['GetCapabilities', 'DescribeFeatureType', 'GetFeature', 'GetPropertyValue', 'ListStoredQueries', 'DescribeStoredQueries',
95+
'CreateStoredQuery', 'DropStoredQuery', 'ImplementsBasicWFS', 'ImplementsTransactionalWFS', 'ImplementsLockingWFS',
96+
'KVPEncoding', 'XMLEncoding', 'SOAPEncoding', 'ImplementsInheritance', 'ImplementsRemoteResolve', 'ImplementsResultPaging',
97+
'ImplementsStandardJoins', 'ImplementsSpatialJoins', 'ImplementsTemporalJoins', 'ImplementsFeatureVersioning',
98+
'ManageStoredQueries', 'PagingIsTransactionSafe', 'QueryExpressions']
9599
96100
List FeatureTypes
97101

98-
::
102+
.. code-block:: python
99103
100-
>>> list(wfs11.contents)
101-
['bvv:vg_ex', 'bvv:bayern_ex', 'bvv:lkr_ex', 'bvv:regbez_ex', 'bvv:gmd_ex']
104+
>>> list(wfs20.contents)
105+
['dijken:dijken_bovenregionale_betekenis', 'dijken:dijklijnenkaart_rce']
102106
103107
Download GML using ``typename``, ``bbox`` and ``srsname``.
104108

105-
::
109+
.. code-block:: python
106110
107111
>>> # OWSLib will switch the axis order from EN to NE automatically if designated by EPSG-Registry
108-
>>> response = wfs11.getfeature(typename='bvv:gmd_ex', bbox=(4500000,5500000,4500500,5500500), srsname='urn:x-ogc:def:crs:EPSG:31468')
112+
>>> response = wfs20.getfeature(typename='dijken:dijklijnenkaart_rce', bbox=(173700,440400,178700,441400), srsname='EPSG:28992')
113+
>>> str(response.read())
114+
'b\'<?xml version="1.0" encoding="UTF-8"?><dijken:dijklijnenkaart_rce...\''
115+
116+
Download in other formats (if supported by server) and pagination.
117+
118+
.. code-block:: python
119+
120+
>>> # Check which output formats are available for GetFeature
121+
>>> [o.parameters['outputFormat']['values'] for o in wfs20.operations if o.name=='GetFeature']
122+
[['application/gml+xml; version=3.2', 'DXF', 'DXF-ZIP', 'GML2', 'KML', 'SHAPE-ZIP', 'application/json', 'application/vnd.google-earth.kml xml',
123+
'application/vnd.google-earth.kml+xml', 'csv', 'gml3', 'gml32', 'json', 'text/csv', 'text/xml; subtype=gml/2.1.2', 'text/xml; subtype=gml/3.1.1', 'text/xml; subtype=gml/3.2']]
124+
>>> response = wfs20.getfeature(typename='dijken:dijklijnenkaart_rce', bbox=(173700,440400,178700,441400), srsname='EPSG:28992', outputFormat='application/json')
125+
>>> response.read()
126+
b'{"type":"FeatureCollection","features":...'
127+
>>> response = wfs20.getfeature(typename='dijken:dijklijnenkaart_rce', srsname='EPSG:4326', maxfeatures=20, startindex=1)
128+
'b\'<?xml version="1.0" encoding="UTF-8"?><dijken:dijklijnenkaart_rce...\''
109129
110130
Return a FeatureType's schema via ``DescribeFeatureType``. The dictionary returned is
111131
compatible with a `Fiona schema object <https://fiona.readthedocs.io/en/latest/fiona.html#fiona.collection.Collection.schema>`_.
112132

113-
::
133+
.. code-block:: python
134+
135+
>>> wfs20.get_schema('dijken:dijklijnenkaart_rce')
136+
{'properties': {'ogc_fid': 'int', 'id': 'string', 'naam': 'string', 'aanleg_beg': 'string', 'aanleg_ein': 'string', 'aanleg_ind': 'string', 'status': 'string', 'herkomst': 'string', 'verdwenen': 'string', 'oorsprfunc': 'string', 'naspfunc': 'string', 'bijzonderh': 'string', 'bron_data': 'string', 'bron_id': 'string', 'bron_geo': 'string', 'rce_zone': 'string', 'waternaam': 'string', 'polder': 'string', 'shape_leng': 'double', 'opmerking': 'string', 'laatst_bew': 'date'}, 'required': ['ogc_fid'], 'geometry': 'GeometryCollection', 'geometry_column': 'wkb_geometry'}
114137
115-
>>> wfs11.get_schema('bvv:vg_ex')
116-
>>> {'properties': {'land': 'string', 'modellart': 'string', 'objart': 'string', 'objart_txt': 'string', 'objid': 'string', 'hdu_x': 'short', 'beginn': 'string', 'ende': 'string', 'adm': 'string', 'avg': 'string', 'bez_gem': 'string', 'bez_krs': 'string', 'bez_lan': 'string', 'bez_rbz': 'string', 'sch': 'string'}, 'geometry': '3D MultiPolygon', 'geometry_column': 'geom'}
117138
118139
Download GML using ``typename`` and ``filter``.
119140

120141
Usage with WFS 1.1 (FE.1.1):
121142

122-
::
143+
.. code-block:: python
123144
124145
>>> from owslib.fes import *
125146
>>> from owslib.etree import etree
126147
>>> from owslib.wfs import WebFeatureService
127-
>>> wfs11 = WebFeatureService(url='http://geoserv.weichand.de:8080/geoserver/wfs', version='1.1.0')
148+
>>> wfs10 = WebFeatureService(url='https://services.rce.geovoorziening.nl/dijken/wfs', version='1.1.0')
128149
129-
>>> filter = PropertyIsLike(propertyname='bez_gem', literal='Ingolstadt', wildCard='*')
150+
>>> filter = PropertyIsLike(propertyname='naam', literal='Haarlemmer*', wildCard='*')
130151
>>> filterxml = etree.tostring(filter.toXML()).decode("utf-8")
131-
>>> response = wfs11.getfeature(typename='bvv:gmd_ex', filter=filterxml)
152+
>>> response = wfs10.getfeature(typename='dijken:dijklijnenkaart_rce', filter=filterxml)
132153
133154
Usage with WFS 2.0 (FE.2.0):
134155

@@ -147,7 +168,7 @@ Usage with WFS 2.0 (FE.2.0):
147168

148169
Save response to a file.
149170

150-
::
171+
.. code-block:: python
151172
152173
>>> out = open('/tmp/data.gml', 'wb')
153174
>>> out.write(bytes(response.read(), 'UTF-8'))
@@ -156,21 +177,22 @@ Save response to a file.
156177
Download GML using ``StoredQueries``\ (only available for WFS 2.0
157178
services)
158179

159-
::
180+
.. code-block:: python
160181
161182
>>> from owslib.wfs import WebFeatureService
162-
>>> wfs20 = WebFeatureService(url='http://geoserv.weichand.de:8080/geoserver/wfs', version='2.0.0')
183+
>>> wfs20 = WebFeatureService(url='https://services.rce.geovoorziening.nl/dijken/wfs', version='2.0.0')
163184
164185
>>> # List StoredQueries
165186
>>> [storedquery.id for storedquery in wfs20.storedqueries]
166-
['bboxQuery', 'urn:ogc:def:query:OGC-WFS::GetFeatureById', 'GemeindeByGemeindeschluesselEpsg31468', 'DWithinQuery']
187+
['urn:ogc:def:query:OGC-WFS::GetFeatureById']
167188
168-
>>> # List Parameters for StoredQuery[1]
169-
>>> parameter.name for parameter in wfs20.storedqueries[1].parameters]
189+
>>> # List Parameters for StoredQuery[0]
190+
>>> [parameter.name for parameter in wfs20.storedqueries[0].parameters]
170191
['ID']
171192
172-
173-
>>> response = wfs20.getfeature(storedQueryID='urn:ogc:def:query:OGC-WFS::GetFeatureById', storedQueryParams={'ID':'gmd_ex.1'})
193+
>>> response = wfs20.getfeature(storedQueryID='urn:ogc:def:query:OGC-WFS::GetFeatureById', storedQueryParams={'ID':'dijklijnenkaart_rce.13364'})
194+
>>> str(response.read())
195+
'b\'<?xml version="1.0" encoding="UTF-8"?><dijken:dijklijnenkaart_rce...\''
174196
175197
OGC API
176198
-------

0 commit comments

Comments
 (0)