<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hernán,</p>
<p>The URL you specify in the WFS: connection string isn't in
general the one of a GetFeature request, but only the endpoint of
the service. When you specify a GetFeature request, some
heuristics trigger, but in WFS 2, the COUNT parameter is
interpreted as the page size, but as this server supports paging,
it is actually overridden by the page size returned by the server
(this part is a bug, addressed per
<a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/pull/4914">https://github.com/OSGeo/gdal/pull/4914</a>), and anyway whatever the
page size used, it scrolls by default through the results.</p>
<p>If you add --config OGR_WFS_PAGING_ALLOWED NO you'll get the
behavior you expect. The above mentioned pull request also
clarifies this hopefully.<br>
</p>
<p>Even<br>
</p>
<div class="moz-cite-prefix">Le 29/11/2021 à 11:43, Hernán De
Angelis a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:08cc2c17-b287-42b4-3a1a-51b551d6b98b@gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<font size="2"><font face="Courier New, Courier, monospace">Dear
all<br>
<br>
I seem to have problems understanding how ogr2ogr interacts
with WFS and hope someone would be able to clarify.<br>
<br>
I have this WFS:<br>
<br>
<a class="moz-txt-link-freetext"
href="https://stationsregister.miljodatasamverkan.se/geoserver/stationsregistret/wfs"
moz-do-not-send="true">https://stationsregister.miljodatasamverkan.se/geoserver/stationsregistret/wfs</a>?<br>
<br>
The capabilities document states that it supports WFS 1.0.0,
1.1.0 and 2.0.0.<br>
<br>
If I do:<br>
<br>
ogr2ogr -f GPKG test.gpkg
"WFS:<a class="moz-txt-link-freetext"
href="https://stationsregister.miljodatasamverkan.se/geoserver/stationsregistret/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=stationsregistret:active_site&MAXFEATURES=100"
moz-do-not-send="true">https://stationsregister.miljodatasamverkan.se/geoserver/stationsregistret/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=stationsregistret:active_site&MAXFEATURES=100</a>"<br>
<br>
I get a small and nice GPKG file very fast.<br>
<br>
But if I do:<br>
<br>
ogr2ogr -f GPKG test.gpkg
"WFS:<a class="moz-txt-link-freetext"
href="https://stationsregister.miljodatasamverkan.se/geoserver/stationsregistret/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TYPENAMES=stationsregistret:active_site&COUNT=100"
moz-do-not-send="true">https://stationsregister.miljodatasamverkan.se/geoserver/stationsregistret/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TYPENAMES=stationsregistret:active_site&COUNT=100</a>"<br>
<br>
It downloads the whole layer.<br>
<br>
This behaviour can be seriously impractical for services
exposing a large number of features.<br>
<br>
<br>
Pay attention that if I do:<br>
<br>
curl
<a class="moz-txt-link-rfc2396E"
href="https://stationsregister.miljodatasamverkan.se/geoserver/stationsregistret/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TYPENAMES=stationsregistret:active_site&COUNT=100"
moz-do-not-send="true">"https://stationsregister.miljodatasamverkan.se/geoserver/stationsregistret/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TYPENAMES=stationsregistret:active_site&COUNT=100"</a><br>
<br>
it retrieves a short document fast with just 100 features. The
same of course if I invoke the service using WFS 1.0.0 or
1.1.0.<br>
<br>
<br>
What is going on here? Is it me that I misunderstood something
about how ogr2ogr is supposed to interact with WFS services?<br>
<br>
Using GDAL 3.4.0, released 2021/11/04. But the same behaviour
was observed in 3.3.2.<br>
<br>
<br>
Thanks in advance for any clarification<br>
<br>
<br>
Hernán<br>
<br>
<br>
<br>
</font></font> <br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>