[gdal-dev] WFS driver bug2 - MAXFEATURES not working

Odd Ragnar Lydersen Odd-Ragnar.Lydersen at powel.no
Thu Sep 29 01:06:12 PDT 2016

So I have tried to dig a bit more into this, and I have noticed a few things.

1)      I set MAXFEATURES=60 in the url

2)      I select the layer I want to work with, let's call it MyLayer.

3)      I call SetSpatialFilterRect() on the MyLayer and set it to a small area containing 11 points.

4)      I call GetFeatureCount() on MyLayer, and then I get 60 features returned, even though I know it should be spatially bound to an area containing only 11 features.

5)      Then I should be iterating through all the features, using GetNextFeature(), but no features are read.

In 4), the result from GetFeatureCount(), should have been 11.
In 5), I should have been able to read the expected 11 features.

>From the code in ogrwfslayer.cpp in GIntBig OGRWFSLayer::ExecuteGetFeatureResultTypeHits():

/* Hum, http://deegree3-testing.deegree.org:80/deegree-inspire-node/services?MAXFEATURES=10&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=ad:Address&OUTPUTFORMAT=text/xml;%20subtype=gml/3.2.1&RESULTTYPE=hits */
/* returns more than MAXFEATURES features... So truncate to MAXFEATURES */
CPLString osMaxFeatures = CPLURLGetValue(osURL, atoi(poDS->GetVersion()) >= 2 ? "COUNT" : "MAXFEATURES");

Does this mean that the use of MAXFEATURES isn't working?
Have not tested this on WFS version 2.x.
Can anyone confirm if it's working in that version?
It would be nice to know.

We may decide to have a go at fixing this in the future, but for now we're just going to disable the use of MAXFEATURES, and just use, SetSpatialFilterRect(), to restrain the number of features returned from a layer.


Fra: Odd Ragnar Lydersen [mailto:Odd-Ragnar.Lydersen at powel.no]
Sendt: onsdag 28. september 2016 14.10
Til: gdal-dev at lists.osgeo.org
Emne: [gdal-dev] WFS driver bug2 - MAXFEATURES not working

When I use the WFS driver (GDAL 2.1.1) for version 1.0.0 or 1.1.0, and add MAXFEATURES to the url, then I get zero features retuned, from the service.
If I drop MAXFEATURES in the request-url, then I get all the features in my bounding box returned from the service.

This is a password protected service, could it be related to my "WFS driver bug1"?

Med vennlig hilsen
Odd-Ragnar Lydersen
System Developer

Powel AS Storgata 27B, Pb 369, N-4349 Bryne, NORWAY
Email: odd-ragnar.lydersen at powel.no<mailto:odd-ragnar.lydersen at powel.no>
[cid:image002.jpg at 01CDD1F7.F470C190]<http://www.powel.no/en>[cid:image004.jpg at 01CDD1F7.F470C190]<https://www.facebook.com/pages/Powel/350917775700>[cid:image006.jpg at 01CDD1F7.F470C190]<http://www.linkedin.com/company/powel-as>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160929/8a904ea3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 1268 bytes
Desc: image001.jpg
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160929/8a904ea3/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 870 bytes
Desc: image002.jpg
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160929/8a904ea3/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 909 bytes
Desc: image003.jpg
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160929/8a904ea3/attachment-0002.jpg>

More information about the gdal-dev mailing list