-
Notifications
You must be signed in to change notification settings - Fork 48
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
Federated search #42
Comments
I have questions. First, would this be enough to support your use case, @matthewhanson? import pystac_client
from pystac_client import Client
client_a = Client.open("http://stac-api-a.test")
client_b = Client.open("http://stac-api-b.test")
search_a = client_a.search(collections=["foo"], datetime="2023-06-07")
search_b = client_b.search(collections=["bar"], datetime="2023-06-07")
items = search_a.item_collection()
items.extend(search_b.item_collection()) If that's enough, then we just need to add an If that's not enough, I'm at a bit of a loss. Each STAC API tends to be so different that it doesn't seem realistic to, e.g., use the same collection IDs across clients. If you want to re-use the same set of parameters, it's pretty trivial to do this: query = {
"datetime": "2023-06-07",
"bbox": [-73.21, 43.99, -73.12, 44.05],
}
items = client_a.search(collections=["foo"], **query).item_collection()
items.extend(client_b.search(collections=["bar"], **query).item_collection()) @matthewhanson, an you sketch out what you had in mind, if it's more than what I've described? |
The important thing here would be to ensure that if an order was specified in the search that the results would be interleaved based on that order. |
Quick and dirty proof of concept for a federated search that merges records according to their sortby settings.
|
For that, I did the sorting just on the items as dicts, but if we were to actually implement this, you could use Items as classes and either create a new subclass or monkeypatch a lt method onto it. |
A big advantage of STAC is being able to use data from multiple sources.
It would be a nice feature to be able to search multiple STAC endpoints and combine the results into a single FeatureCollection
The text was updated successfully, but these errors were encountered: