You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We want to move away from limit-offset paging for the data we're serving from Postgres, as deep pages (requiring large offsets) are inefficient and can result in users downloading duplicate records and missing new records if data is appended to an earlier page. We're hoping to move to keyset paging instead, which means users will provide a (non-numeric) key with their queries to get the next page.
Unfortunately limit-offset paging is baked into the itemtypes API here:
Describe the solution you'd like
Rather than assuming providers are using limit-offset paging, and therefore the last page was always at offset - limit and the next one at offset + limit, it'd be nice if providers could pass their own next links that would skip this entire chunk of code. I think a next link in the response should disable the generation of both prev and next links, as the Features standard mentions that prev links may be skipped based on implementation:
Providing prev links supports navigating back and forth between pages, but depending on the implementation approach it may be too complex to implement.
Describe alternatives you've considered
Potentially each provider should be responsible for implementing a sensible default pagination strategy, but that seems like a much higher lift than assuming (1) the provider is right if it provides a next link (2) the existing strategy can be used otherwise.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
We want to move away from limit-offset paging for the data we're serving from Postgres, as deep pages (requiring large offsets) are inefficient and can result in users downloading duplicate records and missing new records if data is appended to an earlier page. We're hoping to move to keyset paging instead, which means users will provide a (non-numeric) key with their queries to get the next page.
Unfortunately limit-offset paging is baked into the itemtypes API here:
pygeoapi/pygeoapi/api/itemtypes.py
Lines 548 to 574 in c976bd7
Describe the solution you'd like
Rather than assuming providers are using limit-offset paging, and therefore the last page was always at
offset - limit
and the next one atoffset + limit
, it'd be nice if providers could pass their ownnext
links that would skip this entire chunk of code. I think anext
link in the response should disable the generation of bothprev
andnext
links, as the Features standard mentions thatprev
links may be skipped based on implementation:Describe alternatives you've considered
Potentially each provider should be responsible for implementing a sensible default pagination strategy, but that seems like a much higher lift than assuming (1) the provider is right if it provides a
next
link (2) the existing strategy can be used otherwise.The text was updated successfully, but these errors were encountered: