Skip to content

Commit b8ebbc1

Browse files
committedOct 12, 2017
[Server][Tests] Add PyQgsServerWFS test
1 parent d7a48c6 commit b8ebbc1

File tree

10 files changed

+461
-256
lines changed

10 files changed

+461
-256
lines changed
 

‎src/server/services/wfs/qgswfsparameters.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ namespace QgsWfs
136136
else if ( fStr.compare( QLatin1String( "geojson" ), Qt::CaseInsensitive ) == 0 )
137137
f = Format::GeoJSON;
138138

139+
if ( f == Format::NONE &&
140+
request().compare( QLatin1String( "describefeaturetype" ), Qt::CaseInsensitive ) == 0 &&
141+
fStr.compare( QLatin1String( "xmlschema" ), Qt::CaseInsensitive ) == 0 )
142+
f = Format::GML2;
143+
139144
return f;
140145
}
141146

@@ -144,6 +149,14 @@ namespace QgsWfs
144149
return value( ParameterName::SRSNAME ).toString();
145150
}
146151

152+
QString QgsWfsParameters::request() const
153+
{
154+
if ( mRequestParameters.contains( "REQUEST" ) )
155+
return mRequestParameters["REQUEST"];
156+
else
157+
return QString();
158+
}
159+
147160
QString QgsWfsParameters::version() const
148161
{
149162
// VERSION parameter is not managed with other parameters because

‎src/server/services/wfs/qgswfsparameters.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ namespace QgsWfs
8585
*/
8686
void dump() const;
8787

88-
<<<<<<< HEAD
89-
/** Returns VERSION parameter as a string or an empty string if not
90-
=======
9188
/**
9289
* Returns REQUEST parameter as a string or an empty string if not
9390
* defined.
@@ -97,7 +94,6 @@ namespace QgsWfs
9794

9895
/**
9996
* Returns VERSION parameter as a string or an empty string if not
100-
>>>>>>> 747f00d... QgsWfsParameters
10197
* defined.
10298
* \returns version
10399
*/

‎tests/src/python/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ IF (WITH_SERVER)
223223
ADD_PYTHON_TEST(PyQgsServerProjectUtils test_qgsserver_projectutils.py)
224224
ADD_PYTHON_TEST(PyQgsServerSecurity test_qgsserver_security.py)
225225
ADD_PYTHON_TEST(PyQgsServerAccessControl test_qgsserver_accesscontrol.py)
226+
ADD_PYTHON_TEST(PyQgsServerWFS test_qgsserver_wfs.py)
226227
ADD_PYTHON_TEST(PyQgsServerWFST test_qgsserver_wfst.py)
227228
ADD_PYTHON_TEST(PyQgsOfflineEditingWFS test_offline_editing_wfs.py)
228229
ADD_PYTHON_TEST(PyQgsAuthManagerPasswordOWSTest test_authmanager_password_ows.py)

‎tests/src/python/test_qgsserver.py

Lines changed: 0 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -255,156 +255,6 @@ def test_api(self):
255255
expected = self.strip_version_xmlns(b'<ServiceExceptionReport version="1.3.0" xmlns="http://www.opengis.net/ogc">\n <ServiceException code="Service configuration error">Service unknown or unsupported</ServiceException>\n</ServiceExceptionReport>\n')
256256
self.assertEqual(self.strip_version_xmlns(body), expected)
257257

258-
# WFS tests
259-
def wfs_request_compare(self, request):
260-
project = self.testdata_path + "test_project_wfs.qgs"
261-
assert os.path.exists(project), "Project file not found: " + project
262-
263-
query_string = '?MAP=%s&SERVICE=WFS&VERSION=1.0.0&REQUEST=%s' % (urllib.parse.quote(project), request)
264-
header, body = self._execute_request(query_string)
265-
self.assert_headers(header, body)
266-
response = header + body
267-
reference_path = self.testdata_path + 'wfs_' + request.lower() + '.txt'
268-
self.store_reference(reference_path, response)
269-
f = open(reference_path, 'rb')
270-
expected = f.read()
271-
f.close()
272-
response = re.sub(RE_STRIP_UNCHECKABLE, b'', response)
273-
expected = re.sub(RE_STRIP_UNCHECKABLE, b'', expected)
274-
275-
self.assertXMLEqual(response, expected, msg="request %s failed.\n Query: %s" % (query_string, request))
276-
277-
def test_project_wfs(self):
278-
"""Test some WFS request"""
279-
for request in ('GetCapabilities', 'DescribeFeatureType'):
280-
self.wfs_request_compare(request)
281-
282-
def wfs_getfeature_compare(self, requestid, request):
283-
project = self.testdata_path + "test_project_wfs.qgs"
284-
assert os.path.exists(project), "Project file not found: " + project
285-
286-
query_string = '?MAP=%s&SERVICE=WFS&VERSION=1.0.0&REQUEST=%s' % (urllib.parse.quote(project), request)
287-
header, body = self._execute_request(query_string)
288-
self.result_compare(
289-
'wfs_getfeature_' + requestid + '.txt',
290-
"request %s failed.\n Query: %s" % (
291-
query_string,
292-
request,
293-
),
294-
header, body
295-
)
296-
297-
def test_getfeature(self):
298-
tests = []
299-
tests.append(('nobbox', 'GetFeature&TYPENAME=testlayer'))
300-
tests.append(('startindex2', 'GetFeature&TYPENAME=testlayer&STARTINDEX=2'))
301-
tests.append(('limit2', 'GetFeature&TYPENAME=testlayer&MAXFEATURES=2'))
302-
tests.append(('start1_limit1', 'GetFeature&TYPENAME=testlayer&MAXFEATURES=1&STARTINDEX=1'))
303-
304-
for id, req in tests:
305-
self.wfs_getfeature_compare(id, req)
306-
307-
def test_wfs_getcapabilities_url(self):
308-
"""Check that URL in GetCapabilities response is complete"""
309-
# empty url in project
310-
project = os.path.join(self.testdata_path, "test_project_without_urls.qgs")
311-
qs = "?" + "&".join(["%s=%s" % i for i in list({
312-
"MAP": urllib.parse.quote(project),
313-
"SERVICE": "WFS",
314-
"VERSION": "1.3.0",
315-
"REQUEST": "GetCapabilities",
316-
"STYLES": ""
317-
}.items())])
318-
319-
r, h = self._result(self._execute_request(qs))
320-
321-
for item in str(r).split("\\n"):
322-
if "onlineResource" in item:
323-
self.assertEqual("onlineResource=\"?" in item, True)
324-
325-
# url well defined in query string
326-
project = os.path.join(self.testdata_path, "test_project_without_urls.qgs")
327-
qs = "https://www.qgis-server.org?" + "&".join(["%s=%s" % i for i in list({
328-
"MAP": urllib.parse.quote(project),
329-
"SERVICE": "WFS",
330-
"VERSION": "1.3.0",
331-
"REQUEST": "GetCapabilities",
332-
"STYLES": ""
333-
}.items())])
334-
335-
r, h = self._result(self._execute_request(qs))
336-
337-
for item in str(r).split("\\n"):
338-
if "onlineResource" in item:
339-
self.assertTrue("onlineResource=\"https://www.qgis-server.org?" in item, True)
340-
341-
# url well defined in project
342-
project = os.path.join(self.testdata_path, "test_project_with_urls.qgs")
343-
qs = "?" + "&".join(["%s=%s" % i for i in list({
344-
"MAP": urllib.parse.quote(project),
345-
"SERVICE": "WFS",
346-
"VERSION": "1.3.0",
347-
"REQUEST": "GetCapabilities",
348-
"STYLES": ""
349-
}.items())])
350-
351-
r, h = self._result(self._execute_request(qs))
352-
353-
for item in str(r).split("\\n"):
354-
if "onlineResource" in item:
355-
self.assertEqual("onlineResource=\"my_wfs_advertised_url\"" in item, True)
356-
357-
def result_compare(self, file_name, error_msg_header, header, body):
358-
self.assert_headers(header, body)
359-
response = header + body
360-
reference_path = self.testdata_path + file_name
361-
self.store_reference(reference_path, response)
362-
f = open(reference_path, 'rb')
363-
expected = f.read()
364-
f.close()
365-
response = re.sub(RE_STRIP_UNCHECKABLE, b'', response)
366-
expected = re.sub(RE_STRIP_UNCHECKABLE, b'', expected)
367-
self.assertXMLEqual(response, expected, msg="%s\n" % (error_msg_header))
368-
369-
def wfs_getfeature_post_compare(self, requestid, request):
370-
project = self.testdata_path + "test_project_wfs.qgs"
371-
assert os.path.exists(project), "Project file not found: " + project
372-
373-
query_string = '?MAP={}'.format(urllib.parse.quote(project))
374-
header, body = self._execute_request(query_string, requestMethod=QgsServerRequest.PostMethod, data=request.encode('utf-8'))
375-
376-
self.result_compare(
377-
'wfs_getfeature_{}.txt'.format(requestid),
378-
"GetFeature in POST for '{}' failed.".format(requestid),
379-
header, body,
380-
)
381-
382-
def test_getfeature_post(self):
383-
template = """<?xml version="1.0" encoding="UTF-8"?>
384-
<wfs:GetFeature service="WFS" version="1.0.0" {} xmlns:wfs="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
385-
<wfs:Query typeName="testlayer" xmlns:feature="http://www.qgis.org/gml">
386-
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
387-
<ogc:BBOX>
388-
<ogc:PropertyName>geometry</ogc:PropertyName>
389-
<gml:Envelope xmlns:gml="http://www.opengis.net/gml">
390-
<gml:lowerCorner>8 44</gml:lowerCorner>
391-
<gml:upperCorner>9 45</gml:upperCorner>
392-
</gml:Envelope>
393-
</ogc:BBOX>
394-
</ogc:Filter>
395-
</wfs:Query>
396-
</wfs:GetFeature>
397-
"""
398-
399-
tests = []
400-
tests.append(('nobbox_post', template.format("")))
401-
tests.append(('startindex2_post', template.format('startIndex="2"')))
402-
tests.append(('limit2_post', template.format('maxFeatures="2"')))
403-
tests.append(('start1_limit1_post', template.format('startIndex="1" maxFeatures="1"')))
404-
405-
for id, req in tests:
406-
self.wfs_getfeature_post_compare(id, req)
407-
408258
# WCS tests
409259
def wcs_request_compare(self, request):
410260
project = self.projectPath
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
# -*- coding: utf-8 -*-
2+
"""QGIS Unit tests for QgsServer WFS.
3+
4+
From build dir, run: ctest -R PyQgsServerWFS -V
5+
6+
7+
.. note:: This program is free software; you can redistribute it and/or modify
8+
it under the terms of the GNU General Public License as published by
9+
the Free Software Foundation; either version 2 of the License, or
10+
(at your option) any later version.
11+
12+
"""
13+
__author__ = 'René-Luc Dhont'
14+
__date__ = '19/09/2017'
15+
__copyright__ = 'Copyright 2017, The QGIS Project'
16+
# This will get replaced with a git SHA1 when you do a git archive
17+
__revision__ = '$Format:%H$'
18+
19+
import os
20+
21+
# Needed on Qt 5 so that the serialization of XML is consistent among all executions
22+
os.environ['QT_HASH_SEED'] = '1'
23+
24+
import re
25+
import urllib.request
26+
import urllib.parse
27+
import urllib.error
28+
29+
from qgis.server import QgsServerRequest
30+
31+
from qgis.testing import unittest
32+
from qgis.PyQt.QtCore import QSize
33+
34+
import osgeo.gdal # NOQA
35+
36+
from test_qgsserver import QgsServerTestBase
37+
38+
# Strip path and content length because path may vary
39+
RE_STRIP_UNCHECKABLE = b'MAP=[^"]+|Content-Length: \d+'
40+
RE_ATTRIBUTES = b'[^>\s]+=[^>\s]+'
41+
42+
43+
class TestQgsServerWFS(QgsServerTestBase):
44+
45+
"""QGIS Server WFS Tests"""
46+
47+
def wfs_request_compare(self, request, version=''):
48+
project = self.testdata_path + "test_project_wfs.qgs"
49+
assert os.path.exists(project), "Project file not found: " + project
50+
51+
query_string = '?MAP=%s&SERVICE=WFS&REQUEST=%s' % (urllib.parse.quote(project), request)
52+
if version:
53+
query_string += '&VERSION=%s' % version
54+
header, body = self._execute_request(query_string)
55+
self.assert_headers(header, body)
56+
response = header + body
57+
58+
reference_name = 'wfs_' + request.lower()
59+
if version == '1.0.0':
60+
reference_name += '_1_0_0'
61+
reference_name += '.txt'
62+
63+
reference_path = self.testdata_path + reference_name
64+
65+
self.store_reference(reference_path, response)
66+
f = open(reference_path, 'rb')
67+
expected = f.read()
68+
f.close()
69+
response = re.sub(RE_STRIP_UNCHECKABLE, b'', response)
70+
expected = re.sub(RE_STRIP_UNCHECKABLE, b'', expected)
71+
72+
self.assertXMLEqual(response, expected, msg="request %s failed.\n Query: %s" % (query_string, request))
73+
74+
def test_project_wfs(self):
75+
"""Test some WFS request"""
76+
for request in ('GetCapabilities', 'DescribeFeatureType'):
77+
self.wfs_request_compare(request)
78+
self.wfs_request_compare(request, '1.0.0')
79+
80+
def wfs_getfeature_compare(self, requestid, request):
81+
project = self.testdata_path + "test_project_wfs.qgs"
82+
assert os.path.exists(project), "Project file not found: " + project
83+
84+
query_string = '?MAP=%s&SERVICE=WFS&VERSION=1.0.0&REQUEST=%s' % (urllib.parse.quote(project), request)
85+
header, body = self._execute_request(query_string)
86+
self.result_compare(
87+
'wfs_getfeature_' + requestid + '.txt',
88+
"request %s failed.\n Query: %s" % (
89+
query_string,
90+
request,
91+
),
92+
header, body
93+
)
94+
95+
def test_getfeature(self):
96+
tests = []
97+
tests.append(('nobbox', 'GetFeature&TYPENAME=testlayer'))
98+
tests.append(('startindex2', 'GetFeature&TYPENAME=testlayer&STARTINDEX=2'))
99+
tests.append(('limit2', 'GetFeature&TYPENAME=testlayer&MAXFEATURES=2'))
100+
tests.append(('start1_limit1', 'GetFeature&TYPENAME=testlayer&MAXFEATURES=1&STARTINDEX=1'))
101+
102+
for id, req in tests:
103+
self.wfs_getfeature_compare(id, req)
104+
105+
def test_wfs_getcapabilities_100_url(self):
106+
"""Check that URL in GetCapabilities response is complete"""
107+
# empty url in project
108+
project = os.path.join(self.testdata_path, "test_project_without_urls.qgs")
109+
qs = "?" + "&".join(["%s=%s" % i for i in list({
110+
"MAP": urllib.parse.quote(project),
111+
"SERVICE": "WFS",
112+
"VERSION": "1.0.0",
113+
"REQUEST": "GetCapabilities"
114+
}.items())])
115+
116+
r, h = self._result(self._execute_request(qs))
117+
118+
for item in str(r).split("\\n"):
119+
if "onlineResource" in item:
120+
self.assertEqual("onlineResource=\"?" in item, True)
121+
122+
# url well defined in query string
123+
project = os.path.join(self.testdata_path, "test_project_without_urls.qgs")
124+
qs = "https://www.qgis-server.org?" + "&".join(["%s=%s" % i for i in list({
125+
"MAP": urllib.parse.quote(project),
126+
"SERVICE": "WFS",
127+
"VERSION": "1.0.0",
128+
"REQUEST": "GetCapabilities"
129+
}.items())])
130+
131+
r, h = self._result(self._execute_request(qs))
132+
133+
for item in str(r).split("\\n"):
134+
if "onlineResource" in item:
135+
self.assertTrue("onlineResource=\"https://www.qgis-server.org?" in item, True)
136+
137+
# url well defined in project
138+
project = os.path.join(self.testdata_path, "test_project_with_urls.qgs")
139+
qs = "?" + "&".join(["%s=%s" % i for i in list({
140+
"MAP": urllib.parse.quote(project),
141+
"SERVICE": "WFS",
142+
"VERSION": "1.0.0",
143+
"REQUEST": "GetCapabilities"
144+
}.items())])
145+
146+
r, h = self._result(self._execute_request(qs))
147+
148+
for item in str(r).split("\\n"):
149+
if "onlineResource" in item:
150+
self.assertEqual("onlineResource=\"my_wfs_advertised_url\"" in item, True)
151+
152+
def result_compare(self, file_name, error_msg_header, header, body):
153+
self.assert_headers(header, body)
154+
response = header + body
155+
reference_path = self.testdata_path + file_name
156+
self.store_reference(reference_path, response)
157+
f = open(reference_path, 'rb')
158+
expected = f.read()
159+
f.close()
160+
response = re.sub(RE_STRIP_UNCHECKABLE, b'', response)
161+
expected = re.sub(RE_STRIP_UNCHECKABLE, b'', expected)
162+
self.assertXMLEqual(response, expected, msg="%s\n" % (error_msg_header))
163+
164+
def wfs_getfeature_post_compare(self, requestid, request):
165+
project = self.testdata_path + "test_project_wfs.qgs"
166+
assert os.path.exists(project), "Project file not found: " + project
167+
168+
query_string = '?MAP={}'.format(urllib.parse.quote(project))
169+
header, body = self._execute_request(query_string, requestMethod=QgsServerRequest.PostMethod, data=request.encode('utf-8'))
170+
171+
self.result_compare(
172+
'wfs_getfeature_{}.txt'.format(requestid),
173+
"GetFeature in POST for '{}' failed.".format(requestid),
174+
header, body,
175+
)
176+
177+
def test_getfeature_post(self):
178+
template = """<?xml version="1.0" encoding="UTF-8"?>
179+
<wfs:GetFeature service="WFS" version="1.0.0" {} xmlns:wfs="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
180+
<wfs:Query typeName="testlayer" xmlns:feature="http://www.qgis.org/gml">
181+
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
182+
<ogc:BBOX>
183+
<ogc:PropertyName>geometry</ogc:PropertyName>
184+
<gml:Envelope xmlns:gml="http://www.opengis.net/gml">
185+
<gml:lowerCorner>8 44</gml:lowerCorner>
186+
<gml:upperCorner>9 45</gml:upperCorner>
187+
</gml:Envelope>
188+
</ogc:BBOX>
189+
</ogc:Filter>
190+
</wfs:Query>
191+
</wfs:GetFeature>
192+
"""
193+
194+
tests = []
195+
tests.append(('nobbox_post', template.format("")))
196+
tests.append(('startindex2_post', template.format('startIndex="2"')))
197+
tests.append(('limit2_post', template.format('maxFeatures="2"')))
198+
tests.append(('start1_limit1_post', template.format('startIndex="1" maxFeatures="1"')))
199+
200+
for id, req in tests:
201+
self.wfs_getfeature_post_compare(id, req)
202+
203+
if __name__ == '__main__':
204+
unittest.main()

‎tests/src/python/test_qgsserver_wms.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,25 +1827,6 @@ def test_wms_GetLegendGraphic_BBox2(self):
18271827
r, h = self._result(self._execute_request(qs))
18281828
self._img_diff_error(r, h, "WMS_GetLegendGraphic_BBox2")
18291829

1830-
# WCS tests
1831-
def wcs_request_compare(self, request):
1832-
project = self.projectPath
1833-
assert os.path.exists(project), "Project file not found: " + project
1834-
1835-
query_string = '?MAP=%s&SERVICE=WCS&VERSION=1.0.0&REQUEST=%s' % (urllib.parse.quote(project), request)
1836-
header, body = self._execute_request(query_string)
1837-
self.assert_headers(header, body)
1838-
response = header + body
1839-
reference_path = self.testdata_path + 'wcs_' + request.lower() + '.txt'
1840-
self.store_reference(reference_path, response)
1841-
f = open(reference_path, 'rb')
1842-
expected = f.read()
1843-
f.close()
1844-
response = re.sub(RE_STRIP_UNCHECKABLE, b'', response)
1845-
expected = re.sub(RE_STRIP_UNCHECKABLE, b'', expected)
1846-
1847-
self.assertXMLEqual(response, expected, msg="request %s failed.\n Query: %s\n Expected:\n%s\n\n Response:\n%s" % (query_string, request, expected.decode('utf-8'), response.decode('utf-8')))
1848-
18491830

18501831
if __name__ == '__main__':
18511832
unittest.main()

‎tests/testdata/qgis_server/wfs_describefeaturetype.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
Content-Length: 913
1+
Content-Length: 911
22
Content-Type: text/xml; charset=utf-8
33

44
<schema xmlns:gml="http://www.opengis.net/gml" targetNamespace="http://www.qgis.org/gml" xmlns:qgs="http://www.qgis.org/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ogc="http://www.opengis.net/ogc" version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
5-
<import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
5+
<import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"/>
66
<element type="qgs:testlayerType" name="testlayer" substitutionGroup="gml:_Feature"/>
77
<complexType name="testlayerType">
88
<complexContent>
99
<extension base="gml:AbstractFeatureType">
1010
<sequence>
11-
<element maxOccurs="1" type="gml:GeometryPropertyType" minOccurs="0" name="geometry"/>
11+
<element maxOccurs="1" type="gml:PointPropertyType" minOccurs="0" name="geometry"/>
1212
<element type="long" name="id"/>
1313
<element type="string" name="name"/>
1414
<element type="string" name="utf8nameè"/>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Content-Length: 910
2+
Content-Type: text/xml; charset=utf-8
3+
4+
<schema xmlns:gml="http://www.opengis.net/gml" targetNamespace="http://www.qgis.org/gml" xmlns:qgs="http://www.qgis.org/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ogc="http://www.opengis.net/ogc" version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
5+
<import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/2.1.2/feature.xsd"/>
6+
<element type="qgs:testlayerType" name="testlayer" substitutionGroup="gml:_Feature"/>
7+
<complexType name="testlayerType">
8+
<complexContent>
9+
<extension base="gml:AbstractFeatureType">
10+
<sequence>
11+
<element maxOccurs="1" type="gml:PointPropertyType" minOccurs="0" name="geometry"/>
12+
<element type="long" name="id"/>
13+
<element type="string" name="name"/>
14+
<element type="string" name="utf8nameè"/>
15+
</sequence>
16+
</extension>
17+
</complexContent>
18+
</complexType>
19+
</schema>
Lines changed: 116 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,83 @@
1-
Content-Length: 3001
1+
Content-Length: 6031
22
Content-Type: text/xml; charset=utf-8
33

4-
<WFS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows" xmlns="http://www.opengis.net/wfs" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-capabilities.xsd" xmlns:ogc="http://www.opengis.net/ogc" version="1.0.0" xmlns:xlink="http://www.w3.org/1999/xlink" updateSequence="0">
5-
<Service>
6-
<Name>WFS</Name>
7-
<Title>QGIS TestProject</Title>
8-
<Abstract><![CDATA[Some UTF8 text èòù]]></Abstract>
9-
<OnlineResource/>
10-
</Service>
11-
<Capability>
12-
<Request>
13-
<GetCapabilities>
14-
<DCPType>
15-
<HTTP>
16-
<Get onlineResource="?MAP=tests/testdata/qgis_server/test_project_wfs.qgs"/>
17-
</HTTP>
18-
</DCPType>
19-
<DCPType>
20-
<HTTP>
21-
<Post onlineResource="?MAP=tests/testdata/qgis_server/test_project_wfs.qgs"/>
22-
</HTTP>
23-
</DCPType>
24-
</GetCapabilities>
25-
<DescribeFeatureType>
26-
<SchemaDescriptionLanguage>
27-
<XMLSCHEMA/>
28-
</SchemaDescriptionLanguage>
29-
<DCPType>
30-
<HTTP>
31-
<Get onlineResource="?MAP=tests/testdata/qgis_server/test_project_wfs.qgs"/>
32-
</HTTP>
33-
</DCPType>
34-
<DCPType>
35-
<HTTP>
36-
<Post onlineResource="?MAP=tests/testdata/qgis_server/test_project_wfs.qgs"/>
37-
</HTTP>
38-
</DCPType>
39-
</DescribeFeatureType>
40-
<GetFeature>
41-
<ResultFormat>
42-
<GML2/>
43-
<GML3/>
44-
<GeoJSON/>
45-
</ResultFormat>
46-
<DCPType>
47-
<HTTP>
48-
<Get onlineResource="?MAP=tests/testdata/qgis_server/test_project_wfs.qgs"/>
49-
</HTTP>
50-
</DCPType>
51-
<DCPType>
52-
<HTTP>
53-
<Post onlineResource="?MAP=tests/testdata/qgis_server/test_project_wfs.qgs"/>
54-
</HTTP>
55-
</DCPType>
56-
</GetFeature>
57-
<Transaction>
58-
<DCPType>
59-
<HTTP>
60-
<Post onlineResource="?MAP=tests/testdata/qgis_server/test_project_wfs.qgs"/>
61-
</HTTP>
62-
</DCPType>
63-
</Transaction>
64-
</Request>
65-
</Capability>
4+
<WFS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows" xmlns="http://www.opengis.net/wfs" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-capabilities.xsd" xmlns:ogc="http://www.opengis.net/ogc" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" updateSequence="0">
5+
<ows:ServiceIdentification>
6+
<ows:Title>QGIS TestProject</ows:Title>
7+
<ows:Abstract><![CDATA[Some UTF8 text èòù]]></ows:Abstract>
8+
<ows:ServiceType>WFS</ows:ServiceType>
9+
<ows:Fees>None</ows:Fees>
10+
<ows:AccessConstraints>None</ows:AccessConstraints>
11+
</ows:ServiceIdentification>
12+
<ows:ServiceProvider>
13+
<ows:ProviderName>QGIS dev team</ows:ProviderName>
14+
<ows:ServiceContact>
15+
<ows:IndividualName>Alessandro Pasotti</ows:IndividualName>
16+
<ows:Role>PointOfContact</ows:Role>
17+
</ows:ServiceContact>
18+
</ows:ServiceProvider>
19+
<ows:OperationsMetadata>
20+
<ows:Operation name="GetCapabilities">
21+
<ows:DCP>
22+
<ows:HTTP>
23+
<ows:Get xlink:type="xlink:simple" xlink:href="?MAP=/home/dhont/3liz_dev/QGIS/qgis_rldhont/tests/testdata/qgis_server/test_project_wfs.qgs"/>
24+
<ows:Get xlink:type="xlink:simple" xlink:href="?MAP=/home/dhont/3liz_dev/QGIS/qgis_rldhont/tests/testdata/qgis_server/test_project_wfs.qgs"/>
25+
</ows:HTTP>
26+
</ows:DCP>
27+
<ows:Parameter name="service">
28+
<ows:Value>WFS</ows:Value>
29+
</ows:Parameter>
30+
<ows:Parameter name="AcceptVersions">
31+
<ows:Value>1.1.0</ows:Value>
32+
<ows:Value>1.0.0</ows:Value>
33+
</ows:Parameter>
34+
<ows:Parameter name="AcceptFormats">
35+
<ows:Value>text/xml</ows:Value>
36+
</ows:Parameter>
37+
</ows:Operation>
38+
<ows:Operation name="DescribeFeatureType">
39+
<ows:DCP>
40+
<ows:HTTP>
41+
<ows:Get xlink:type="xlink:simple" xlink:href="?MAP=/home/dhont/3liz_dev/QGIS/qgis_rldhont/tests/testdata/qgis_server/test_project_wfs.qgs"/>
42+
<ows:Get xlink:type="xlink:simple" xlink:href="?MAP=/home/dhont/3liz_dev/QGIS/qgis_rldhont/tests/testdata/qgis_server/test_project_wfs.qgs"/>
43+
</ows:HTTP>
44+
</ows:DCP>
45+
<ows:Parameter name="outputFormat">
46+
<ows:Value>XMLSCHEMA</ows:Value>
47+
<ows:Value>text/xml; subtype=gml/2.1.2</ows:Value>
48+
<ows:Value>text/xml; subtype=gml/3.1.1</ows:Value>
49+
</ows:Parameter>
50+
</ows:Operation>
51+
<ows:Operation name="GetFeature">
52+
<ows:DCP>
53+
<ows:HTTP>
54+
<ows:Get xlink:type="xlink:simple" xlink:href="?MAP=/home/dhont/3liz_dev/QGIS/qgis_rldhont/tests/testdata/qgis_server/test_project_wfs.qgs"/>
55+
<ows:Get xlink:type="xlink:simple" xlink:href="?MAP=/home/dhont/3liz_dev/QGIS/qgis_rldhont/tests/testdata/qgis_server/test_project_wfs.qgs"/>
56+
</ows:HTTP>
57+
</ows:DCP>
58+
<ows:Parameter name="outputFormat">
59+
<ows:Value>text/xml; subtype=gml/2.1.2</ows:Value>
60+
<ows:Value>text/xml; subtype=gml/3.1.1</ows:Value>
61+
<ows:Value>application/vnd.geo+json</ows:Value>
62+
</ows:Parameter>
63+
<ows:Parameter name="resultType">
64+
<ows:Value>results</ows:Value>
65+
</ows:Parameter>
66+
</ows:Operation>
67+
<ows:Operation name="Transaction">
68+
<ows:DCP>
69+
<ows:HTTP>
70+
<ows:Get xlink:type="xlink:simple" xlink:href="?MAP=/home/dhont/3liz_dev/QGIS/qgis_rldhont/tests/testdata/qgis_server/test_project_wfs.qgs"/>
71+
<ows:Get xlink:type="xlink:simple" xlink:href="?MAP=/home/dhont/3liz_dev/QGIS/qgis_rldhont/tests/testdata/qgis_server/test_project_wfs.qgs"/>
72+
</ows:HTTP>
73+
</ows:DCP>
74+
<ows:Parameter name="inputFormat">
75+
<ows:Value>text/xml; subtype=gml/2.1.2</ows:Value>
76+
<ows:Value>text/xml; subtype=gml/3.1.1</ows:Value>
77+
<ows:Value>application/vnd.geo+json</ows:Value>
78+
</ows:Parameter>
79+
</ows:Operation>
80+
</ows:OperationsMetadata>
6681
<FeatureTypeList>
6782
<Operations>
6883
<Query/>
@@ -71,8 +86,15 @@ Content-Type: text/xml; charset=utf-8
7186
<Name>testlayer</Name>
7287
<Title>A test vector layer</Title>
7388
<Abstract>A test vector layer with unicode òà</Abstract>
74-
<SRS>EPSG:4326</SRS>
75-
<LatLongBoundingBox maxy="44.9015" maxx="8.20355" miny="44.9014" minx="8.20346"/>
89+
<DefaultSRS>EPSG:4326</DefaultSRS>
90+
<OtherSRS>EPSG:3857</OtherSRS>
91+
<OutputFormats>
92+
<Format>text/xml; subtype=gml/3.1.1</Format>
93+
</OutputFormats>
94+
<ows:WGS84BoundingBox dimensions="2">
95+
<ows:LowerCorner>8.20346 44.9014</ows:LowerCorner>
96+
<ows:UpperCorner>8.20355 44.9015</ows:UpperCorner>
97+
</ows:WGS84BoundingBox>
7698
<Operations>
7799
<Query/>
78100
<Insert/>
@@ -83,23 +105,37 @@ Content-Type: text/xml; charset=utf-8
83105
</FeatureTypeList>
84106
<ogc:Filter_Capabilities>
85107
<ogc:Spatial_Capabilities>
86-
<ogc:Spatial_Operators>
87-
<ogc:BBOX/>
88-
<ogc:Disjoint/>
89-
<ogc:Intersect/>
90-
<ogc:Touches/>
91-
<ogc:Crosses/>
92-
<ogc:Contains/>
93-
<ogc:Overlaps/>
94-
<ogc:Within/>
95-
</ogc:Spatial_Operators>
108+
<ogc:GeometryOperands>
109+
<ogc:GeometryOperand>gml:Point</ogc:GeometryOperand>
110+
<ogc:GeometryOperand>gml:LineString</ogc:GeometryOperand>
111+
<ogc:GeometryOperand>gml:Polygon</ogc:GeometryOperand>
112+
<ogc:GeometryOperand>gml:Envelope</ogc:GeometryOperand>
113+
</ogc:GeometryOperands>
114+
<ogc:SpatialOperators>
115+
<ogc:SpatialOperator>Equals</ogc:SpatialOperator>
116+
<ogc:SpatialOperator>Disjoint</ogc:SpatialOperator>
117+
<ogc:SpatialOperator>Touches</ogc:SpatialOperator>
118+
<ogc:SpatialOperator>Within</ogc:SpatialOperator>
119+
<ogc:SpatialOperator>Overlaps</ogc:SpatialOperator>
120+
<ogc:SpatialOperator>Crosses</ogc:SpatialOperator>
121+
<ogc:SpatialOperator>Intersects</ogc:SpatialOperator>
122+
<ogc:SpatialOperator>Contains</ogc:SpatialOperator>
123+
<ogc:SpatialOperator>DWithin</ogc:SpatialOperator>
124+
<ogc:SpatialOperator>Beyond</ogc:SpatialOperator>
125+
<ogc:SpatialOperator>BBOX</ogc:SpatialOperator>
126+
</ogc:SpatialOperators>
96127
</ogc:Spatial_Capabilities>
97128
<ogc:Scalar_Capabilities>
98-
<ogc:Comparison_Operators>
99-
<ogc:Simple_Comparisons/>
100-
<ogc:Between/>
101-
<ogc:Like/>
102-
</ogc:Comparison_Operators>
129+
<ogc:LogicalOperators/>
130+
<ogc:ComparisonOperators>
131+
<ogc:ComparisonOperator>LessThan</ogc:ComparisonOperator>
132+
<ogc:ComparisonOperator>GreaterThan</ogc:ComparisonOperator>
133+
<ogc:ComparisonOperator>LessThanEqualTo</ogc:ComparisonOperator>
134+
<ogc:ComparisonOperator>GreaterThanEqualTo</ogc:ComparisonOperator>
135+
<ogc:ComparisonOperator>EqualTo</ogc:ComparisonOperator>
136+
<ogc:ComparisonOperator>Like</ogc:ComparisonOperator>
137+
<ogc:ComparisonOperator>Between</ogc:ComparisonOperator>
138+
</ogc:ComparisonOperators>
103139
</ogc:Scalar_Capabilities>
104140
</ogc:Filter_Capabilities>
105141
</WFS_Capabilities>
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
Content-Length: 3001
2+
Content-Type: text/xml; charset=utf-8
3+
4+
<WFS_Capabilities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows" xmlns="http://www.opengis.net/wfs" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-capabilities.xsd" xmlns:ogc="http://www.opengis.net/ogc" version="1.0.0" xmlns:xlink="http://www.w3.org/1999/xlink" updateSequence="0">
5+
<Service>
6+
<Name>WFS</Name>
7+
<Title>QGIS TestProject</Title>
8+
<Abstract><![CDATA[Some UTF8 text èòù]]></Abstract>
9+
<OnlineResource/>
10+
</Service>
11+
<Capability>
12+
<Request>
13+
<GetCapabilities>
14+
<DCPType>
15+
<HTTP>
16+
<Get onlineResource="?MAP=tests/testdata/qgis_server/test_project_wfs.qgs"/>
17+
</HTTP>
18+
</DCPType>
19+
<DCPType>
20+
<HTTP>
21+
<Post onlineResource="?MAP=tests/testdata/qgis_server/test_project_wfs.qgs"/>
22+
</HTTP>
23+
</DCPType>
24+
</GetCapabilities>
25+
<DescribeFeatureType>
26+
<SchemaDescriptionLanguage>
27+
<XMLSCHEMA/>
28+
</SchemaDescriptionLanguage>
29+
<DCPType>
30+
<HTTP>
31+
<Get onlineResource="?MAP=tests/testdata/qgis_server/test_project_wfs.qgs"/>
32+
</HTTP>
33+
</DCPType>
34+
<DCPType>
35+
<HTTP>
36+
<Post onlineResource="?MAP=tests/testdata/qgis_server/test_project_wfs.qgs"/>
37+
</HTTP>
38+
</DCPType>
39+
</DescribeFeatureType>
40+
<GetFeature>
41+
<ResultFormat>
42+
<GML2/>
43+
<GML3/>
44+
<GeoJSON/>
45+
</ResultFormat>
46+
<DCPType>
47+
<HTTP>
48+
<Get onlineResource="?MAP=tests/testdata/qgis_server/test_project_wfs.qgs"/>
49+
</HTTP>
50+
</DCPType>
51+
<DCPType>
52+
<HTTP>
53+
<Post onlineResource="?MAP=tests/testdata/qgis_server/test_project_wfs.qgs"/>
54+
</HTTP>
55+
</DCPType>
56+
</GetFeature>
57+
<Transaction>
58+
<DCPType>
59+
<HTTP>
60+
<Post onlineResource="?MAP=tests/testdata/qgis_server/test_project_wfs.qgs"/>
61+
</HTTP>
62+
</DCPType>
63+
</Transaction>
64+
</Request>
65+
</Capability>
66+
<FeatureTypeList>
67+
<Operations>
68+
<Query/>
69+
</Operations>
70+
<FeatureType>
71+
<Name>testlayer</Name>
72+
<Title>A test vector layer</Title>
73+
<Abstract>A test vector layer with unicode òà</Abstract>
74+
<SRS>EPSG:4326</SRS>
75+
<LatLongBoundingBox maxy="44.9015" maxx="8.20355" miny="44.9014" minx="8.20346"/>
76+
<Operations>
77+
<Query/>
78+
<Insert/>
79+
<Update/>
80+
<Delete/>
81+
</Operations>
82+
</FeatureType>
83+
</FeatureTypeList>
84+
<ogc:Filter_Capabilities>
85+
<ogc:Spatial_Capabilities>
86+
<ogc:Spatial_Operators>
87+
<ogc:BBOX/>
88+
<ogc:Disjoint/>
89+
<ogc:Intersect/>
90+
<ogc:Touches/>
91+
<ogc:Crosses/>
92+
<ogc:Contains/>
93+
<ogc:Overlaps/>
94+
<ogc:Within/>
95+
</ogc:Spatial_Operators>
96+
</ogc:Spatial_Capabilities>
97+
<ogc:Scalar_Capabilities>
98+
<ogc:Comparison_Operators>
99+
<ogc:Simple_Comparisons/>
100+
<ogc:Between/>
101+
<ogc:Like/>
102+
</ogc:Comparison_Operators>
103+
</ogc:Scalar_Capabilities>
104+
</ogc:Filter_Capabilities>
105+
</WFS_Capabilities>

0 commit comments

Comments
 (0)
Please sign in to comment.