<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<p>Jukka,</p>
<p>your analysis is completely correct. Whether this is expected or
not probably depends on situations. Should we have a
INITIAL_REQUEST_PAGE_SIZE=number open option to overload the
number of features to retrieve specifically in the first
request... ??</p>
<p>Regarding the spatial filter, it is passed through the OGR API
generally after having queried the schema, and for most OGR
datasources it wouldn't influence the schema, so there isn't much
that can be done here, except maybe adding a
BBOX=west,south,east,north open option.<br>
</p>
<p>One option to avoid both issues would be for the service to
publish DescribedBy links at the collection level that would point
to a XML schema (using a GML Simple Feature schema profile, such
as the one understood by the GML driver) or a JSON schema (not
"too" complicated too). Both are handled by the driver.</p>
<p>Even<br>
</p>
<div class="moz-cite-prefix">Le 27/09/2021 à 15:21, Rahkonen Jukka
(MML) a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:4d8879ba99dd4d21a4806c34b0b03b9e@maanmittauslaitos.fi">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@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;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
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;}span.Shkpostityyli18
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}div.WordSection1
{page:WordSection1;}</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]-->
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I tried to read a
relatively small BBOX from an OAPIF server but the process
feels rather slow and I do not quite understand what I am
seeing in the log.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">ogr2ogr -f GPKG
test.gpkg OAPIF:<a
href="https://avoin-paikkatieto.maanmittauslaitos.fi/maastotiedot/features/v1/?api-key=xxxx"
moz-do-not-send="true">https://avoin-paikkatieto.maanmittauslaitos.fi/maastotiedot/features/v1/?api-key=xxxx</a>
-spat 25 65 25.1 65.1 -oo PAGE_SIZE=10000 --debug on
--config cpl_curl_verbose yes<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Excerpts from the log:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">HTTP: Fetch(<a
href="https://avoin-paikkatieto.maanmittauslaitos.fi/maastotiedot/features/v1/collections/osoitepiste/items?api-key=xxxx&f=json&limit=10000"
moz-do-not-send="true">https://avoin-paikkatieto.maanmittauslaitos.fi/maastotiedot/features/v1/collections/osoitepiste/items?api-key=xxxx&f=json&limit=10000</a>)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">HTTP: These HTTP headers
were set: Accept: application/geo+json, application/json<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> GET
/maastotiedot/features/v1/collections/osoitepiste/items?api-key=xxxx&f=json&limit=10000
HTTP/1.1<o:p></o:p></span></p>
<p class="MsoNormal">Host:
avoin-paikkatieto.maanmittauslaitos.fi<o:p></o:p></p>
<p class="MsoNormal">Accept-Encoding: gzip<o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Accept:
application/geo+json, application/json<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">* Mark bundle as not
supporting multiuse<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">< HTTP/1.1 200 OK<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">GeoJSON: First pass:
56.54 %<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">GeoJSON: First pass:
100.00 %<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">HTTP: Fetch(<a
href="https://avoin-paikkatieto.maanmittauslaitos.fi/maastotiedot/features/v1/collections/osoitepiste/items?api-key=xxxx&f=json&limit=10000&bbox=25,65,25.1000000000000014,65.0999999999999943"
moz-do-not-send="true">https://avoin-paikkatieto.maanmittauslaitos.fi/maastotiedot/features/v1/collections/osoitepiste/items?api-key=xxxx&f=json&limit=10000&bbox=25,65,25.1000000000000014,65.0999999999999943</a>)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">> GET
/maastotiedot/features/v1/collections/osoitepiste/items?api-key=xxxx&f=json&limit=10000&bbox=25,65,25.1000000000000014,65.0999999999999943
HTTP/1.1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">< Content-Length: 309<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">GDALVectorTranslate: 0
features written in layer 'osoitepiste'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Do I read right that
GDAL is first reading one page, in this time 10000 features
without BBOX, perhaps for resolving the schema, and then
makes a new query with BBOX? In this case the BBOX query
finds nothing. Reading 10000 features on the first round and
then discarding everything feels too expensive. Could it be
enough to read for example 10 features that is the default
page size on the first round instead of the full page?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
</div>
<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>