Skip to content

Commit 16ba918

Browse files
authoredMar 19, 2018
Merge pull request #6638 from elpaso/wfs-fix-getfeature-featureid-endless-loop
[bugfix][server][wfs] Fix endless loop in getfeature
2 parents 092557b + a160e74 commit 16ba918

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed
 

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ namespace QgsWfs
536536

537537
query.featureRequest = featureRequest;
538538
request.queries.append( query );
539+
fidsMapIt++;
539540
}
540541
return request;
541542
}

‎tests/src/python/test_qgsserver_wfs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ def test_getFeatureBBOX(self):
268268
self.wfs_request_compare("GetFeature", '1.1.0', "SRSNAME=EPSG:4326&TYPENAME=testlayer&RESULTTYPE=hits&BBOX=913144,5605992,913303,5606048,EPSG:3857", 'wfs_getFeature_1_1_0_epsgbbox_3_feature_3857')
269269
self.wfs_request_compare("GetFeature", '1.1.0', "SRSNAME=EPSG:4326&TYPENAME=testlayer&RESULTTYPE=hits&BBOX=913206,5606024,913213,5606026,EPSG:3857", 'wfs_getFeature_1_1_0_epsgbbox_1_feature_3857')
270270

271+
def test_getFeatureFeatureId(self):
272+
"""Test GetFeature with featureid"""
273+
self.wfs_request_compare("GetFeature", '1.0.0', "SRSNAME=EPSG:4326&TYPENAME=testlayer&FEATUREID=testlayer.0", 'wfs_getFeature_1_0_0_featureid_0')
274+
271275

272276
if __name__ == '__main__':
273277
unittest.main()
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Content-Type: text/xml; subtype=gml/2.1.2; charset=utf-8
2+
3+
<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:qgs="http://www.qgis.org/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd http://www.qgis.org/gml ?MAP=/home/ale/dev/QGIS/tests/testdata/qgis_server/test_project_wfs.qgs&amp;SRSNAME=EPSG:4326&amp;SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=testlayer&amp;OUTPUTFORMAT=XMLSCHEMA">
4+
<gml:boundedBy>
5+
<gml:Box srsName="EPSG:4326">
6+
<gml:coordinates cs="," ts=" ">8.20345931,44.90139484 8.20354699,44.90148253</gml:coordinates>
7+
</gml:Box>
8+
</gml:boundedBy>
9+
<gml:featureMember>
10+
<qgs:testlayer fid="testlayer.0">
11+
<gml:boundedBy>
12+
<gml:Box srsName="EPSG:4326">
13+
<gml:coordinates cs="," ts=" ">8.20349634,44.90148253 8.20349634,44.90148253</gml:coordinates>
14+
</gml:Box>
15+
</gml:boundedBy>
16+
<qgs:geometry>
17+
<Point xmlns="http://www.opengis.net/gml" srsName="EPSG:4326">
18+
<coordinates xmlns="http://www.opengis.net/gml" cs="," ts=" ">8.20349634,44.90148253</coordinates>
19+
</Point>
20+
</qgs:geometry>
21+
<qgs:id>1</qgs:id>
22+
<qgs:name>one</qgs:name>
23+
<qgs:utf8nameè>one èé</qgs:utf8nameè>
24+
</qgs:testlayer>
25+
</gml:featureMember>
26+
</wfs:FeatureCollection>

0 commit comments

Comments
 (0)
Please sign in to comment.