datacube-dataset-config icon indicating copy to clipboard operation
datacube-dataset-config copied to clipboard

Planetary Computer S2 index issue

Open diplonics opened this issue 11 months ago • 3 comments

Getting the below error when trying to index PC S2 data. No changes our side so suspect its a PC issue as even existing ODC indexed PC S2 data is not accessible. Have reached out to PC guys for thoughts but may need product file change ODC side if they've implemented something fundamental!!!

ERROR: Failed to handle item S2B_MSIL2A_20250101T113409_R080_T29UNU_20250101T134107 Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/odc/apps/dc_tools/stac_api_to_dc.py", line 194, in stac_api_to_odc _ = future.result() File "/usr/lib/python3.8/concurrent/futures/_base.py", line 437, in result return self.__get_result() File "/usr/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result raise self._exception File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.8/dist-packages/odc/apps/dc_tools/stac_api_to_dc.py", line 132, in process_item index_update_dataset( File "/usr/local/lib/python3.8/dist-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; {'nir09', 'coastal', 'rededge2', 'blue', 'swir16', 'wvp', 'nir08', 'scl', 'nir', 'red', 'swir22', 'rededge1', 'rededge3', 'green', 'aot'} The URI was https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-2-l2a/items/S2B_MSIL2A_20250101T113409_R080_T29UNU_20250101T134107

diplonics avatar May 15 '25 15:05 diplonics

On a quick glance, it looks like PC have switched from using symbolic band names ('red', 'blue', etc) to ESA's standard numbered band names ('B01', 'B02', 'B03').

Are you using the latest 's2_l2a' product definition from this repo?

SpacemanPaul avatar May 16 '25 00:05 SpacemanPaul

Yep, we are using the latest file from this repo. Older Datacube version 1.8.6 though, will have to find time to migrate if the issue is a legacy version thing. Was indexing S2 fine last month.

diplonics avatar May 16 '25 07:05 diplonics

Not sure where things have changed, PC side, ODC side or some issue with stac-to-dc handling dataset metadata. Anyway, for our instance of ODC, Explorer and OWS we are using the attached S2 Product file to get everything working. Seems the version in this repo won't work for PC Indexing: https://raw.githubusercontent.com/opendatacube/datacube-dataset-config/main/products/s2_l2a.odc-product.yaml

s2_l2a.odc-product.yaml.txt

diplonics avatar Jun 17 '25 16:06 diplonics