Hi,
when trying to calculate multiple indices using the predefined process ndvi
we receive an error message concerning band referencing. This is a new error, the code as posted below worked when we first tried it while following the instructions in the openEO cookbook.
collections = "SENTINEL2_L2A_SENTINELHUB"
bands = c("B02", "B03", "B04", "B08", "B11", "B12")
period = c("2021-04-01", "2021-06-30")
ext = list(11.14079 , 49.75891, 11.1432, 49.76039)
names(ext) = c("west", "south", "east", "north")
# change to login with your credentials
# con = openeo::connect("https://openeo.cloud")
# login(
# login_type = "oidc"
# , provider = "egi"
# , config = list(
# client_id = "<client_id>"
# , secret = "<secret>"
# )
# )
procs = openeo::processes()
cube = procs$load_collection(
id = collections
, spatial_extent = ext
, temporal_extent = period
, bands = bands
)
cube_ndvi = procs$ndvi(
data = cube
, red = "B04"
, nir = "B08"
, target_band = "NDVI"
)
cube_ndwi = procs$ndvi(
data = cube_ndvi
, red = "B12"
, nir = "B08"
, target_band = "NDWI"
)
cube_ind = procs$ndvi(
data = cube_ndwi
, red = "B12"
, nir = "B11"
, target_band = "NSMI"
)
## create and start job
job = openeo::create_job(cube_ind)
openeo::start_job(job)
id = as.character(job$id)
jobs = openeo::list_jobs()
jobs[[id]]
openeo::log_job(id)
Maybe something has changed from the back-end side regarding the proper way to index the specific bands? In case you can access the job logs, this is the ID showing the error message: “vito-6d5864dd-f1be-41e5-b6e9-b774ab27d50a”
Thanks as always!