stac-utils / pgstac

Schema, functions and a python library for storing and accessing STAC collections and items in PostgreSQL
MIT License
153 stars 39 forks source link

Add collection search functionality #289

Closed hrodmn closed 4 months ago

hrodmn commented 4 months ago

Collection-level search is an important tool for data discovery that can unblock users who need to know which collection(s) they are interested in before they are ready to do an item-level search.

There is a proposed collection-search extension to support this feature in the STAC API spec. It has been implemented in at least one STAC, and the result is really powerful when paired with a tool like STAC Browser: https://radiantearth.github.io/stac-browser/#/search/external/emc.spacebel.be/?.language=en

For this feature to work well in pgstac it would be important for collection extents to be properly synced with the item extents, which might not always be the case.

Perhaps related to https://github.com/stac-utils/pgstac/issues/139, but I think this is a different feature.

vincentsarago commented 4 months ago

in 0.8.2 we've added collection_search method

https://github.com/stac-utils/pgstac/blob/3ba567c27cbdb26f7654611df29504d04a73136a/src/pgstac/sql/004a_collectionsearch.sql#L81-L95

https://github.com/stac-utils/pgstac/blob/main/CHANGELOG.md#v082

but this is not yet used at stac-fastapi level: https://github.com/stac-utils/stac-fastapi/pull/696

hrodmn commented 4 months ago

Amazing, thanks for pointing that out @vincentsarago!