Skip to content

Commit 67b86ee

Browse files
committed
Aggregated STAC loading eg load all wanted bands per collection/date/resample.
For this example deroob/Public/EU_model_V2_ECDC/ECDC-EUmodelv2_v2_data_used.csv can be used.
1 parent a24a0e4 commit 67b86ee

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/eo_processing/openeo/processing.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22
import itertools
3+
from ast import literal_eval
34
import openeo
45
from openeo.rest.datacube import DataCube
56
from 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

Comments
 (0)