Help for STAC catalogs #569
-
Hello, I am under the impression that even if STAC is a normalized standard now, there are still many ways to access it. For example, I am trying to download HLS data: from eodag import setup_logging
from eodag.api.core import EODataAccessGateway
if __name__ == "__main__":
# Create an EODAG custom STAC provider
setup_logging(verbose=3)
dag = EODataAccessGateway()
# Add the custom STAC provider + output + login an password
catalog_path = 'https://cmr.earthdata.nasa.gov/stac/LPCLOUD/collections'
outputs_prefix = r"D:\hls_eodag"
dag.update_providers_config(r"""
hls:
search:
type: StacSearch
api_endpoint: %s
products:
GENERIC_PRODUCT_TYPE:
productType: '{productType}'
download:
type: AwsDownload
flatten_top_dirs: True
base_uri: https://data.lpdaac.earthdatacloud.nasa.gov
outputs_prefix: %s
""" % (catalog_path, outputs_prefix))
# Set the custom STAC provider as preferred
dag.set_preferred_provider("hls")
# Query every product from inside the catalog
hls_prod, _ = dag.search(start="2013-04-10", end="2013-04-15")
# from eodag.plugins.crunch.filter_property import FilterProperty
print(len(hls_prod))
paths = dag.download_all(hls_prod) The logs are:
As you can see, the logs are displaying However, I cannot query any product. What am I missing ? And I wanted to know how do you know what |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
See also https://eodag.readthedocs.io/en/latest/notebooks/tutos/tuto_stac_client.html |
Beta Was this translation helpful? Give feedback.
-
Thanks for this answer, especially to the STAC link :) So if I'm right, Capella is Static when HLS is not ? |
Beta Was this translation helpful? Give feedback.
-
Is there a way to currently make AWS Temporary Credentials work in EODAG ? |
Beta Was this translation helpful? Give feedback.
-
Is there a way to burn STAC metadata in a JSON? file ? For example, for Capella data, they say they provide a metadata .json file corresponding to stac data (see here, p. 8), but they don't give this file as an asset (see this example) I'm thinking maybe offering the possibility (thanks to a callback ?) to create a stac.json file correponding to STAC metadata could be useful. What do you think ? |
Beta Was this translation helpful? Give feedback.
search.api_endpoint
in your example should be https://cmr.earthdata.nasa.gov/stac/LPCLOUD/search (this is standard, see https://github.com/radiantearth/stac-api-spec/tree/main/item-search).And
download.base_uri
is not used in this case and is there for compatibilityStaticStacSearch
is used to search on a static STAC catalog, which is just a structure of static JSON files.StacSearch
is used to search on a STAC API serviceSee also https://eodag.readthedocs.io/en/latest/notebooks/tutos/tuto_stac_client.html