<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EpostStil18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EpostStil19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:570389031;
        mso-list-type:hybrid;
        mso-list-template-ids:737844384 996172176 68419587 68419589 68419585 68419587 68419589 68419585 68419587 68419589;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1
        {mso-list-id:1857041624;
        mso-list-type:hybrid;
        mso-list-template-ids:624298796 68419601 68419609 68419611 68419599 68419609 68419611 68419599 68419609 68419611;}
@list l1:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l1:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="NO-BOK" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB">So I have tried to dig a bit more into this, and I have noticed a few things.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l1 level1 lfo1"><![if !supportLists]><span lang="EN-GB"><span style="mso-list:Ignore">1)<span style="font:7.0pt "Times New Roman"">     
</span></span></span><![endif]><span lang="EN-GB">I set </span><span lang="EN-GB" style="mso-fareast-language:NO-BOK">MAXFEATURES=60 in the url</span><span lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l1 level1 lfo1"><![if !supportLists]><span lang="EN-GB"><span style="mso-list:Ignore">2)<span style="font:7.0pt "Times New Roman"">     
</span></span></span><![endif]><span lang="EN-GB">I select the layer I want to work with, let’s call it MyLayer.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l1 level1 lfo1"><![if !supportLists]><span lang="EN-GB"><span style="mso-list:Ignore">3)<span style="font:7.0pt "Times New Roman"">     
</span></span></span><![endif]><span lang="EN-GB">I call </span><span lang="EN-GB" style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:NO-BOK">SetSpatialFilterRect()</span><span lang="EN-GB"> on the MyLayer and set it to a small area containing
 11 points.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l1 level1 lfo1"><![if !supportLists]><span lang="EN-GB"><span style="mso-list:Ignore">4)<span style="font:7.0pt "Times New Roman"">     
</span></span></span><![endif]><span lang="EN-GB">I call </span><span lang="EN-GB" style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:NO-BOK">GetFeatureCount()</span><span lang="EN-GB"> 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.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l1 level1 lfo1"><![if !supportLists]><span lang="EN-GB"><span style="mso-list:Ignore">5)<span style="font:7.0pt "Times New Roman"">     
</span></span></span><![endif]><span lang="EN-GB">Then I should be iterating through all the features, using
</span><span lang="EN-GB" style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:NO-BOK">GetNextFeature(),</span><span lang="EN-GB"> but no features are read.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">In 4), the result from GetFeatureCount(), should have been 11.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">In 5), I should have been able to read the expected 11 features.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">From the code in ogrwfslayer.cpp in </span>
<span lang="EN-GB" style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:NO-BOK">GIntBig OGRWFSLayer::ExecuteGetFeatureResultTypeHits()</span><span lang="EN-GB">:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-GB" style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:NO-BOK">/* 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
 */<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt;text-autospace:none"><span lang="EN-GB" style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:NO-BOK">/* returns more than MAXFEATURES features... So truncate to MAXFEATURES */<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:NO-BOK">CPLString osMaxFeatures = CPLURLGetValue(osURL,
<i>atoi</i>(poDS->GetVersion()) >= 2 ? "COUNT" : "MAXFEATURES");<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><span lang="EN-GB" style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:NO-BOK"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Does this mean that the use of MAXFEATURES isn’t working?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Have not tested this on WFS version 2.x. <o:p>
</o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Can anyone confirm if it’s working in that version?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">It would be nice to know.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">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,
</span><span lang="EN-GB" style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:NO-BOK">SetSpatialFilterRect()</span><span lang="EN-GB">, to restrain the number of features returned from a layer.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">>Odd-Ragnar<<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="mso-fareast-language:NO-BOK">Fra:</span></b><span style="mso-fareast-language:NO-BOK"> Odd Ragnar Lydersen [mailto:Odd-Ragnar.Lydersen@powel.no]
<br>
<b>Sendt:</b> onsdag 28. september 2016 14.10<br>
<b>Til:</b> gdal-dev@lists.osgeo.org<br>
<b>Emne:</b> [gdal-dev] WFS driver bug2 - MAXFEATURES not working<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-GB">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">If I drop MAXFEATURES in the request-url, then I get all the features in my bounding box returned from the service.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">This is a password protected service, could it be related to my “WFS driver bug1”?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;color:black;mso-fareast-language:NO-BOK">Med vennlig hilsen</span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:NO-BOK"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="color:black;mso-fareast-language:NO-BOK">Odd-Ragnar Lydersen</span></b><span style="mso-fareast-language:NO-BOK"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;color:black;mso-fareast-language:NO-BOK">System Developer</span><span style="mso-fareast-language:NO-BOK"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:8.0pt;color:black;mso-fareast-language:NO-BOK"> </span></b><span style="mso-fareast-language:NO-BOK"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="color:black;mso-fareast-language:NO-BOK">Powel AS</span></b><span style="font-size:10.0pt;color:black;mso-fareast-language:NO-BOK">
</span><span style="font-size:8.0pt;color:black;mso-fareast-language:NO-BOK">Storgata 27B, Pb 369, N-4349 Bryne, NORWAY</span><span style="mso-fareast-language:NO-BOK"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;color:black;mso-fareast-language:NO-BOK">Email:
<a href="mailto:odd-ragnar.lydersen@powel.no"><span style="color:blue">odd-ragnar.lydersen@powel.no</span></a>
</span><span style="mso-fareast-language:NO-BOK"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:NO-BOK"><a href="http://www.powel.com/" title="http://www.powel.com/"><span lang="EN-GB" style="font-size:8.0pt;color:blue">www.powel.no</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><a href="http://www.powel.no/en"><span style="color:windowtext;mso-fareast-language:NO-BOK;text-decoration:none"><img border="0" width="89" height="26" style="width:.927in;height:.2708in" id="Picture_x0020_1" src="cid:image001.jpg@01D21A32.D006CFC0" alt="cid:image002.jpg@01CDD1F7.F470C190"></span></a><a href="https://www.facebook.com/pages/Powel/350917775700"><span style="color:windowtext;mso-fareast-language:NO-BOK;text-decoration:none"><img border="0" width="26" height="26" style="width:.2708in;height:.2708in" id="Picture_x0020_2" src="cid:image002.jpg@01D21A32.D006CFC0" alt="cid:image004.jpg@01CDD1F7.F470C190"></span></a><a href="http://www.linkedin.com/company/powel-as"><span style="color:windowtext;mso-fareast-language:NO-BOK;text-decoration:none"><img border="0" width="30" height="28" style="width:.3125in;height:.2916in" id="Picture_x0020_3" src="cid:image003.jpg@01D21A32.D006CFC0" alt="cid:image006.jpg@01CDD1F7.F470C190"></span></a><span style="mso-fareast-language:NO-BOK"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>