Hi,
When using resample_spatial to both re-project and resample in the same step the job gives an error.
See the following example:
collections = "SENTINEL2_L2A_SENTINELHUB"
bands = c("B02", "B03", "B04", "B08", "SCL")
period = c("2021-04-01", "2021-06-30")
ext = list(11.12692, 49.74992, 11.15708, 49.76938)
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
)
# resampling
res_cube = p$resample_spatial(
cube
, resolution = 20
, projection = 3035
, method = "near"
)
## create process graph
graph = procs$save_result(
data = res_cube
, format = "GTiff"
)
## create and start job
job = openeo::create_job(graph)
openeo::start_job(job)
id = job$id
jobs = openeo::list_jobs()
jobs[[id]]$status
openeo::log_job(job = job)
However, dividing resampling and re-projection into two separate processes works fine:
proj_cube = p$resample_spatial(
cube
, projection = 3035
# , method = "near"
)
res_cube = p$resample_spatial(
proj_cube
, resolution = 20
, method = "near"
)
## create process graph
graph = procs$save_result(
data = res_cube
, format = "GTiff"
)
## create and start job
job = openeo::create_job(graph)
openeo::start_job(job)
id = job$id
jobs = openeo::list_jobs()
dirout = path.expand("~/Downloads/openEO/resample")
if (!dir.exists(dirout)) dir.create(dirout)
openeo::download_results(
job = jobs[[id]]$id
, folder = dirout
)
## create stars object
fls = list.files(dirout, pattern = "^openEO_", full.names = TRUE)
stars = stars::read_stars(fls, along = "time")
stars = stats::setNames(stars, nm = "value")
Unfortunately, analyzing the error does not give us many clues as to what goes wrong. Maybe you have any ideas?