developmentseed / eoapi-devseed

Custom eoAPI framework example for DevelopmentSeed
https://eoapi.dev/customization/
MIT License
5 stars 2 forks source link

[Custom runtimes - STAC] Implement `limit` and `offset` for the `/collections` endpoint #7

Open vincentsarago opened 8 months ago

vincentsarago commented 8 months ago

By default the /collections endpoint will return ALL collections it finds in pgstac. This is ok when there are not too many collections, but definitely not a good idea when you have more than 100 collections (I was about to ingest 400 collections from LINZ when I realized it would mostly break the endpoint).

in tipgstac I showed how to use limit/offset using pgstac.collections table

https://github.com/developmentseed/tipgstac/blob/main/tipgstac/dependencies.py#L48-L54

instead of the pgstac.all_collections() function

https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/stac_fastapi/pgstac/core.py#L44-L49

vincentsarago commented 8 months ago

let's first update the PgSTAC version to 0.8.2 so we can use the new collection_search https://github.com/stac-utils/pgstac/blob/main/CHANGELOG.md#v082