Skip to content

Commit 19e7978

Browse files
committed
Issue #699: add support/tests for S2 STAC collections in the wild
1 parent 189cb9b commit 19e7978

File tree

4 files changed

+2638
-1
lines changed

4 files changed

+2638
-1
lines changed

openeo/metadata.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,10 @@ def bands_from_stac_collection(
810810
return _BandList(self._band_from_eo_bands_metadata(b) for b in collection.summaries.lists["eo:bands"])
811811
elif "bands" in collection.summaries.lists:
812812
return _BandList(self._band_from_common_bands_metadata(b) for b in collection.summaries.lists["bands"])
813+
elif "bands" in collection.extra_fields:
814+
# TODO: is this actually valid and necessary to support? https://github.com/radiantearth/stac-spec/issues/1346
815+
# TODO: avoid `extra_fields`, but built-in "bands" support seems to be scheduled for pystac V2
816+
return _BandList(self._band_from_common_bands_metadata(b) for b in collection.extra_fields["bands"])
813817
# Check item assets if available
814818
elif _PYSTAC_1_12_ITEM_ASSETS and collection.item_assets:
815819
return self._bands_from_item_assets(collection.item_assets)
@@ -862,7 +866,7 @@ def bands_from_stac_asset(self, asset: pystac.Asset) -> _BandList:
862866
self._warn_undeclared_metadata(field="eo:bands", ext="eo")
863867
return _BandList(self._band_from_eo_bands_metadata(b) for b in asset.extra_fields["eo:bands"])
864868
elif "bands" in asset.extra_fields:
865-
# TODO: avoid extra_fields, but built-in "bands" support seems to be scheduled for pystac V2
869+
# TODO: avoid `extra_fields`, but built-in "bands" support seems to be scheduled for pystac V2
866870
return _BandList(self._band_from_common_bands_metadata(b) for b in asset.extra_fields["bands"])
867871

868872
# TODO: instead of warning: exception, or return None?

0 commit comments

Comments
 (0)