Skip to content

CI: kx-3.2-bionic.338

Compare
Choose a tag to compare
WFS: Don't issue STARTINDEX if feature count is small

Backports https://github.com/OSGeo/gdal/pull/8146

Datasources with no primary key cannot be naturally ordered by the
server, and so using the STARTINDEX argument causes a 400 error with the
response:

> Cannot do natural order without a primary key, please add it or
> specify a manual sort over existing attributes

This change avoids issuing STARTINDEX if:
* the feature count is known by the time the first GetFeature request is
  issued
* the feature count is less than the page size.

In other words, this change allows us to use small datasets that have no
primary key, while still allowing paging in larger datasets (as long
as they have a primary key)