Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for STAC API - Collection Search #722

Open
hrodmn opened this issue Aug 5, 2024 · 7 comments
Open

Support for STAC API - Collection Search #722

hrodmn opened this issue Aug 5, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@hrodmn
Copy link

hrodmn commented Aug 5, 2024

It can be difficult for a user to identify which collection they want to query from a STAC before they begin searching for items. I have been thinking a lot about improving the ergonomics of collection discovery lately while working on a tool for federated collection discovery. Most of the code in that project is just a mechanism for crawling through the collections returned by the /collections endpoint and checking to see if they match the provided search criteria.

The STAC API - Collection Search extension is intended to provide an API endpoint for filtering collections based on some criteria. It is not implemented widely yet but it enriches the collection discovery process significantly when paired with a client application like this STAC Browser example.

What needs to happen to add a collection_search method to the pystac.Client?

@gadomski gadomski added the enhancement New feature or request label Aug 5, 2024
@gadomski
Copy link
Member

gadomski commented Aug 5, 2024

While you're correct that there is an extension for collection search, it's a bit out-of-date (e.g. it references v1.0.0-rc.1 of the STAC API spec, itself is v1.0.0-rc.1, and is pilot maturity). I see from stac-api-extensions/collection-search@4ad94f2 that there are two implementations, which helps — if they're public, that would provide us APIs to write tests against.

I think the TODOs to include collection search in pystac-client would be:

  • Identify one or more public API instances to write tests against
  • Create a Client.collection_search that would return a CollectionSearch instance, the same way that Client.search returns an ItemSearch
  • Build out CollectionSearch, which would likely share a lot of behavior w/ ItemSearch
  • (optional but desirable) Release v1.0.0 of the collection search extension and get a public API to update to new release

@m-mohr you've touched collection search stuff more than I have, any additional thoughts?

@hrodmn
Copy link
Author

hrodmn commented Aug 5, 2024

The only public implementation that I am aware of is https://emc.spacebel.be/

There is already a collection_search function in pgstac, and I am working on stac-utils/stac-fastapi-pgstac#136. Once that's stable I intend to deploy it to some public APIs that Development Seed maintains.

@m-mohr
Copy link

m-mohr commented Aug 5, 2024

Collection Search is there to stay, fastapi has an implementation, STAC Browser, too.

Good point that rc.1 of the API is referenced. Please open an issue for it (have to run). Thanks.

@gadomski
Copy link
Member

gadomski commented Aug 5, 2024

@m-mohr issue: stac-api-extensions/collection-search#16

@hrodmn
Copy link
Author

hrodmn commented Sep 13, 2024

👋 @gadomski - I would like to get started on this feature sometime soon!

Since most STAC APIs will not have the collection-search extension enabled until it is fully implemented in the common STAC API frameworks and the updates are deployed, what would you think about adding collection filtering capability to pystac-client in the meantime?

I hacked together a system for filtering results from the /collections endpoint in the federated collection discovery repo. It is not pretty but it makes it possible to perform a collection search by iterating through the pages returned by /collections and keeping collections that overlap with the search terms.

@gadomski
Copy link
Member

Since most STAC APIs will not have the collection-search extension enabled until it is fully implemented in the common STAC API frameworks and the updates are deployed, what would you think about adding collection filtering capability to pystac-client in the meantime?

I think it makes sense, maybe with a warning so the user knows that they're doing things "the hard way" (i.e. client-side).

@m-mohr
Copy link

m-mohr commented Sep 14, 2024

... also if it's paginated, users should be made aware that the result is probably incomplete...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants