File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ def get_bands(self, asset=None):
55
55
"""Gets an Item or an Asset bands.
56
56
57
57
If an Asset is supplied and the bands property exists on the Asset,
58
- returns the Asset's value. Otherwise returns the Item's value
58
+ returns the Asset's value. Otherwise returns the Item's value or
59
+ all the asset's eo bands
59
60
60
61
Returns:
61
62
List[Band]
@@ -65,6 +66,13 @@ def get_bands(self, asset=None):
65
66
else :
66
67
bands = self .item .properties .get ('eo:bands' )
67
68
69
+ # get assets with eo:bands even if not in item
70
+ if bands is None :
71
+ bands = []
72
+ for (value ) in self .item .get_assets ().items ():
73
+ if 'eo:bands' in value .properties :
74
+ bands .extend (value .properties .get ('eo:bands' ))
75
+
68
76
if bands is not None :
69
77
bands = [Band (b ) for b in bands ]
70
78
You can’t perform that action at this time.
0 commit comments