opendatacube / odc-tools

ODC features that DEA is experimenting with or prototyping with the intention of being integrated into odc-core in the future
Apache License 2.0
62 stars 33 forks source link

Trying to index sentinel data into open data cude using this command stac-to-dc --catalog-href='https://earth-search.aws.element84.com/v0/' --bbox='25,20,35,30' --collections='sentinel-s2-l2a-cogs' --datetime='2020-01-01/2020-03-31' .But it shows exception #586

Open chiranjivSharma opened 10 months ago

chiranjivSharma commented 10 months ago

/home/bel/miniconda3/envs/cubeenv1/lib/python3.11/site-packages/pystac_client/client.py:186: NoConformsTo: Server does not advertise any conformance classes. warnings.warn(NoConformsTo()) Traceback (most recent call last): File "/home/bel/miniconda3/envs/cubeenv1/bin/stac-to-dc", line 8, in sys.exit(cli()) ^^^^^ File "/home/bel/miniconda3/envs/cubeenv1/lib/python3.11/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/bel/miniconda3/envs/cubeenv1/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/home/bel/miniconda3/envs/cubeenv1/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/bel/miniconda3/envs/cubeenv1/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/bel/miniconda3/envs/cubeenv1/lib/python3.11/site-packages/odc/apps/dc_tools/stac_api_to_dc.py", line 302, in cli added, failed, skipped = stac_api_to_odc( ^^^^^^^^^^^^^^^^ File "/home/bel/miniconda3/envs/cubeenv1/lib/python3.11/site-packages/odc/apps/dc_tools/stac_api_to_dc.py", line 159, in stac_api_to_odc search = client.search(config) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/bel/miniconda3/envs/cubeenv1/lib/python3.11/site-packages/pystac_client/client.py", line 591, in search raise DoesNotConformTo( pystac_client.warnings.DoesNotConformTo: Server does not conform to ITEM_SEARCH, There is not fallback option available for search.

alexgleith commented 10 months ago

Can you please share what parameters you've used for the tool?

I think you may be using a STAC API endpoint/catalog URL that isn't appropriate.

alexgleith commented 10 months ago

Oh, I see it's in your title https://earth-search.aws.element84.com/v0/

Please use their V1 API: earth-search.aws.element84.com/v1/

chiranjivSharma commented 10 months ago

stac-to-dc --catalog-href='https://earth-search.aws.element84.com/v1/' --bbox='25,20,35,30' --collections='sentinel-s2-l2a-cogs' --datetime='2023-01-01/2023-03-31' .....used this v1 api ,getting below mentioned message

11/03/2023 03:58:53: WARNING: Didn't find any items, finishing. Added 0 Datasets, failed 0 Datasets, skipped 0 Datasets

could you help on this.

alexgleith commented 10 months ago

Oh, you need to change the name of the collection to the new one.

chiranjivSharma commented 10 months ago

could you help on identifying the new collection name

alexgleith commented 10 months ago

Sorry, yeah. It's this one: https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a

The name is sentinel-2-l2a.

I'll update the documentation.

chiranjivSharma commented 10 months ago

stac-to-dc --catalog-href='https://earth-search.aws.element84.com/v1/' --bbox='25,20,35,30' --collections='sentinel-2-l2a' --datetime='2023-01-01/2023-01-02'....used this command now. But now I am getting below mentioned error message....

Indexing from STAC API... /home/bel/miniconda3/envs/cubeenv1/lib/python3.11/site-packages/pystac_client/item_search.py:850: FutureWarning: get_all_items() is deprecated, use item_collection() instead. warnings.warn( 11/03/2023 04:22:06: ERROR: Failed to handle item S2B_35QNE_20230101_0_L2A Traceback (most recent call last): File "/home/bel/miniconda3/envs/cubeenv1/lib/python3.11/site-packages/odc/apps/dc_tools/stac_api_to_dc.py", line 194, in stac_api_toodc = future.result() ^^^^^^^^^^^^^^^ File "/home/bel/miniconda3/envs/cubeenv1/lib/python3.11/concurrent/futures/_base.py", line 449, in result return self.get_result() ^^^^^^^^^^^^^^^^^^^ File "/home/bel/miniconda3/envs/cubeenv1/lib/python3.11/concurrent/futures/_base.py", line 401, in get_result raise self._exception File "/home/bel/miniconda3/envs/cubeenv1/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/bel/miniconda3/envs/cubeenv1/lib/python3.11/site-packages/odc/apps/dc_tools/stac_api_to_dc.py", line 132, in process_item index_update_dataset( File "/home/bel/miniconda3/envs/cubeenv1/lib/python3.11/site-packages/odc/apps/dc_tools/utils.py", line 218, in index_update_dataset raise IndexingException( odc.apps.dc_tools.utils.IndexingException: Failed to create dataset with error The dataset is not specifying all of the measurements in this product. Missing fields are; {'B04', 'B8A', 'B01', 'B11', 'B09', 'B07', 'SCL', 'B03', 'B05', 'B06', 'WVP', 'B02', 'AOT', 'B08', 'B12'} The URI was s3://sentinel-cogs/sentinel-s2-l2a-cogs/35/Q/NE/2023/1/S2B_35QNE_20230101_0_L2A/S2B_35QNE_20230101_0_L2A.json

Like this for many other similar messages. Any idea on this, as in what could go wrong. Earlier to this I added a product with datacube product add s2_l2a.odc-product.yaml this command.

chiranjivSharma commented 10 months ago

Finally it shows- Added 0 Datasets, failed 87 Datasets, skipped 0 Datasets message

alexgleith commented 10 months ago

Ooh, the product definition needs to change too...

chiranjivSharma commented 10 months ago

you got any link to that other product definition yaml file and do I need to remove the earlier product definition file before adding the new one?

alexgleith commented 10 months ago

Can you please check this, maybe test the new product definition: https://github.com/opendatacube/datacube-dataset-config/compare/main...alexgleith-patch-1?quick_pull=1

You can update the product with datacube product update --allow-unsafe <path-to-file>.yaml

chiranjivSharma commented 10 months ago

Thanks it helped