Bug report #19100
WFS request with combined filter (BBOX + PropertyIsEqual) not working
Status: | In Progress | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | QGIS Server | ||
Affected QGIS version: | 3.0.3 | Regression?: | No |
Operating System: | Windows | Easy fix?: | No |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 26930 |
Description
I'm having problems getting a WFS request using a filter with two conditions (BBOX + PropertyIsEqual) to work with QGIS Server. My goal is to get all features within a certain area that have an attribute with a certain value. Sounds simple enough.
http://localhost:8081/cgi-bin/gis.server?service=WFS&request=GetFeature&version=1.1.0&map=C:\OSGeo4W\var\qgis\gis\overview.qgs&srsname=EPSG:3857&typename=projects&outputformat=geojson&filter=<Filter><And xmlns="http://www.opengis.net/ogc"><Or><PropertyIsEqualTo><PropertyName>id</PropertyName><Literal>8</Literal></PropertyIsEqualTo><PropertyIsEqualTo><PropertyName>id</PropertyName><Literal>9</Literal></PropertyIsEqualTo></Or><BBOX><PropertyName>geometry</PropertyName><Envelope xmlns="http://www.opengis.net/gml" srsName="EPSG:3857"><lowerCorner>1501468.311742801 6893026.717014579</lowerCorner><upperCorner>1505075.184015008 6896901.1188857835</upperCorner></Envelope></BBOX></And></Filter>
QGIS Server always returns an empty feature set on the combined request. Running separate requests with only a single filter condition however returns the correct results. I'm unsure as to whether my filter syntax is somehow wrong or QGIS Server doesn't support logical operators at all. Any help or fix would be appreciated!
History
#1 Updated by René-Luc ReLuc over 6 years ago
A PR has been merged in 3.2 and probably fixed it.
https://github.com/qgis/QGIS/pull/7007
Can you test it ?
#2 Updated by Arnaud Morvan over 6 years ago
Pull Request 7007 fix SRS issue only for the case BBOX is direct child of an And, itself direct child of the Filter Element, which may be a common case in a GetFeature request.
#3 Updated by Andreas Steffens over 6 years ago
Yes ... i can confirm that 7007 fixes the issue under the condition mentioned by Arnaud.
#4 Updated by Alessandro Pasotti over 6 years ago
- Status changed from Open to In Progress
Is this now fixed in master?