11from __future__ import annotations
22import itertools
3+ from ast import literal_eval
34import openeo
45from openeo .rest .datacube import DataCube
56from openeo .extra .spectral_indices import append_indices , compute_indices
@@ -459,7 +460,7 @@ def generate_nonEO_feature_cube(
459460
460461 chunk_size : int = processing_options .get ("openeo_chunk_size" , CHUNK_SIZE )
461462
462- for collection , band , reproj , year in collections_list :
463+ for collection , bands , reproj , year in collections_list :
463464 #first need to distinguish between STAC and collection
464465 #we assume that they will allways be an url type of link in contrary with a collections which should just be a name
465466 if temporal_extent :
@@ -468,16 +469,16 @@ def generate_nonEO_feature_cube(
468469 isSTAC = STAC_url is not None
469470
470471 #secondly we know there are some specific case of reprojection EG DEM should be bilinear iso near
471- isDEM = "DEM" in band
472+ isDEM = "DEM" in bands
472473 if reproj :
473474 reprojection_method = reproj
474475 else :
475476 reprojection_method = "near"
476477
477- bands = [band ]
478478 # load the features from public STAC
479+
479480 if isSTAC :
480- if bands == [None ]:
481+ if bands == []:
481482 bands = metadata_from_stac (STAC_url ).band_names
482483 #to be checked does the temporal filtering work on eg WERN
483484 nonEO_feature_cube = connection .load_stac (STAC_url ,
@@ -488,7 +489,7 @@ def generate_nonEO_feature_cube(
488489
489490 else :
490491 #if openeo the -v1 should be split off of the collection
491- if bands == [None ]:
492+ if bands == []:
492493 nonEO_feature_cube = connection .load_collection (collection .split ('-' )[0 ],
493494 temporal_extent = temporal_extent )
494495 nonEO_feature_cube .result_node ().update_arguments (featureflags = {'tilesize' : chunk_size })
0 commit comments