<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Jukka,</p>
    <p>yes it would make sense for the driver to use a larger page size.
      You can file an issue about that</p>
    <p>Actually we could reuse the same logic as the QGIS OAPIF provider
      that determines the page size from the limit.schema.maximum and
      limit.schema.default values of the /api response:<br>
    </p>
    <p>    if ( apiRequest.defaultLimit() > 0 &&
      apiRequest.maxLimit() > 0 )<br>
          {<br>
            // Use the default, but if it is below 1000, aim for 1000<br>
            // but clamp to the maximum limit<br>
            mShared->mPageSize = std::min( std::max( 1000,
      apiRequest.defaultLimit() ), apiRequest.maxLimit() );<br>
          }<br>
          else if ( apiRequest.defaultLimit() > 0 )<br>
            mShared->mPageSize = std::max( 1000,
      apiRequest.defaultLimit() );<br>
          else if ( apiRequest.maxLimit() > 0 )<br>
            mShared->mPageSize = apiRequest.maxLimit();<br>
          else<br>
            mShared->mPageSize = 100; // fallback to arbitrary page
      size</p>
    <p><br>
    </p>
    <p>Even<br>
    </p>
    <div class="moz-cite-prefix">Le 06/10/2023 à 16:39, Rahkonen Jukka
      via gdal-dev a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:AM0PR09MB3219B1E0DF12EE9F9D4F08E4FDC9A@AM0PR09MB3219.eurprd09.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <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.Shkpostityyli17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        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">Hi,<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><span lang="EN-US">The OAPIF driver is
            using page size of 10 features by default
            <a
href="https://gdal.org/drivers/vector/oapif.html#open-options"
              moz-do-not-send="true" class="moz-txt-link-freetext">https://gdal.org/drivers/vector/oapif.html#open-options</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">“PAGE_SIZE=<integer>:
            Defaults to 10. Number of features to retrieve per request.
            Minimum is 1, maximum 10000.”<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 know that 10 is the
            default page size (“limit”) also in the standard but I think
            that this is too small page size, both for the users and
            especially for the service providers. Most users run GDAL
            utilities with the defaults. The buildings collection in our
            OGC API Features service has about 5 million features, which
            means that GDAL users are fetching the data by sending half
            a million request. That is much slower for the users than
            making 500 request, 10000 features each. And think about our
            log files.<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">The better default page
            size would be the biggest that the OAPIF server supports. By
            the standard the maximum is 10000 but service providers may
            use bigger or smaller maximum page sizes. By the standard
            the server can always return less features than client is
            asking with “limit=” and the client must be prepared to
            follow the next links.<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">My suggestion for the
            new page size default is 10000. If that feels too big for
            some reason, then would 1000 feel better?<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="moz-mime-attachment-header"></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>