geopython / pygeoapi

pygeoapi is a Python server implementation of the OGC API suite of standards. The project emerged as part of the next generation OGC API efforts in 2018 and provides the capability for organizations to deploy a RESTful OGC API endpoint using OpenAPI, GeoJSON, and HTML. pygeoapi is open source and released under an MIT license.
https://pygeoapi.io
MIT License
459 stars 250 forks source link

html display does not show prev-next page (anymore) #1703

Closed pvgenuchten closed 12 hours ago

pvgenuchten commented 2 days ago

this came up during tartu workshop

the buttons to navigate to previous next page of item hits seems unavailable

webb-ben commented 1 day ago

Note: This is an artifact of the CSV provider, not the HTML template.

You'll notice this produces a different numberMatched depending on the number of features returned:

https://demo.pygeoapi.io/master/collections/obs/items?f=json&limit=1

https://demo.pygeoapi.io/master/collections/obs/items?f=json&limit=10

The challenge is that pygeoapi determines if it needs to generate next links if the numberReturned does not match the numberMatched (i.e more results to return).

The html templates work just fine for other providers:

https://demo.pygeoapi.io/master/collections/lakes/items

The issue is that the CSV provider just returns the number of features. Still something worth fixing, but not in the HTML templates.

https://github.com/geopython/pygeoapi/blob/cbab803c0da0c5cd4c02090bb8c5c89950372283/pygeoapi/provider/csv_.py#L173

pvgenuchten commented 1 day ago

Thank you @webb-ben for checking, we noticed the behavior also on wfs facade

webb-ben commented 1 day ago

You'll notice this is also because of the numberMatched / numberReturned except the OGR provider does not include either of these values in the response:

https://demo.pygeoapi.io/master/collections/dutch_castles/items?f=json&limit=1

tomkralidis commented 12 hours ago

FYI I've updated the CSV provider in #1710 to reflect an accurate numberMatched value (albeit at a performance hit, but the CSV provider is mostly for reference anyway, so +1 for completeness/accuracy here).

For OGR-based functionality, we should continue this discussion in #1658