1

I have s3 private bucket which contains .tif files. Now, I need to create STAC file like the following:

My goal is to index file (in Open Data Cube) with the stac-to-dc method.

How can I create this .json file?

1 Answer 1

2

Great question. The easiest way to do this is using RIO STAC, which was developed by the magnificent Vincent Sarago. I use it programmatically (from Python).

Make sure you enable the Projection extension, but other than that, that's all you need to do.

Here's some code that does it.

And example is this:


    item = create_stac_item(
        path_to_tif_file,
        id="this-can-be-any-string",
        with_proj=True,
        input_datetime=datetime(2021, 12, 25),
        properties={
            "odc:product": "not_required_but_useful_for_odc"
        },
    )
1
  • Thank you Alex! I will try!
    – Cormogolov
    Feb 10 at 22:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.