Open barbuz opened 1 month ago
numberMatched
is provider-dependent.
I see that the ogr
provider computes numberMatched
when asking for the hits (does it make sense to generate a "next" link for the hits?):
This is the reply for the records:
The main issue in using layer.GetFeatureCount()
is that could kill performances in some cases, but we do not need to use that just to know if there are more records: we can increment numMatched
if there is more, so that the next
link is generated.
numberMatched
(and numberReturned
for that matter, even though it is mostly a function of len(features])
) are optional properties of an OGC API - Features /collections/{collectionId}/items
response. numberMatched
may be expensive to calculate in some cases, which is why it is optional (some search engines exhibit the same behaviour).
Having said this, prev
/next
links are also optional parts of an OGC API - Features /collections/{collectionId}/items
response.
As a result, providers are not required to implement paging, however it is great if they can do so efficiently.
@frafra what is the status of #1662?
Description When querying a features collection which should return a result with more features than the limit, there appears to be no "next" link in the result to get the next page. Additionally, following the "json" link removes the "offset" parameter from the query and goes to the first page of results.
Steps to Reproduce This is visible in the demo instance: https://demo.pygeoapi.io/master/collections/dutch_castles/items?limit=10&offset=20
And also in the corresponding json (with offset parameter manually added): https://demo.pygeoapi.io/master/collections/dutch_castles/items?f=json&limit=10&offset=20
And same for the stable version: https://demo.pygeoapi.io/stable/collections/dutch_castles/items?limit=10&offset=20 https://demo.pygeoapi.io/stable/collections/dutch_castles/items?f=json&limit=10&offset=20
Notice how there is a "prev" link to the previous page but no way to go to the next page.
Expected behavior All pages except the last should contain a "next" link. The "json" link should keep all the same parameters as the original query.
Screenshots/Tracebacks![image](https://github.com/geopython/pygeoapi/assets/7130022/4da831fa-b89a-45bf-81ae-5024161032f0)
Environment