Skip to content

Commit

Permalink
Unit test for feature info geometry filter
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jun 24, 2017
1 parent 77b9b1a commit ef8e58b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/src/python/test_qgsserver_wms.py
Expand Up @@ -125,6 +125,15 @@ def test_project_wms(self):
'query_layers=testlayer%20%C3%A8%C3%A9&' +
'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib.parse.quote(':"NAME" = \'two\' OR "utf8nameè" = \'three èé↓\''),
'wms_getfeatureinfo_filter_or_utf8')

# Test feature info request with filter geometry
self.wms_request_compare('GetFeatureInfo',
'&layers=testlayer%20%C3%A8%C3%A9&' +
'INFO_FORMAT=text%2Fxml&' +
'width=600&height=400&srs=EPSG%3A3857&' +
'query_layers=testlayer%20%C3%A8%C3%A9&' +
'FEATURE_COUNT=10&FILTER_GEOM=POLYGON((8.2035381 44.901459,8.2035562 44.901459,8.2035562 44.901418,8.2035381 44.901418,8.2035381 44.901459))',
'wms_getfeatureinfo_geometry_filter')

# Test DescribeLayer
self.wms_request_compare('DescribeLayer',
Expand Down
14 changes: 14 additions & 0 deletions tests/testdata/qgis_server/wms_getfeatureinfo_geometry_filter.txt
@@ -0,0 +1,14 @@
Content-Length: 261
Content-Type: text/xml; charset=utf-8

<GetFeatureInfoResponse>
<Layer name="testlayer èé">
<Feature id="1">
<Attribute name="id" value="2"/>
<Attribute name="name" value="two"/>
<Attribute name="utf8nameè" value="two àò"/>
<BoundingBox CRS="EPSG:3857" minx="913214.6741" maxx="913214.6741" miny="5606017.8743" maxy="5606017.8743"/>
<Attribute name="geometry" value="Point (913214.6741 5606017.8743)" type="derived"/>
</Feature>
</Layer>
</GetFeatureInfoResponse>

0 comments on commit ef8e58b

Please sign in to comment.