Hi,
to test a small dummy ML workflow I would like to extract pixel values from an existing job result to generate a training data set.
The preprocessed raster data cube (jobID = vito-j-0af01b04c09940ef968374f7fc951502) has multiple bands but no temporal dimension. I can view it in the editor and download it as a .tif (10 Mb).
The sampling locations are simplified 20m buffers around two point coordinates (octagons) to make sure they overlap cell centers. Using the R-client I pass them as an sf object projected in the right CRS.
My process fails when using the preprocessed data cube, but succeeds when using an existing collection like CLC. I saw load_result()
is labeled experimental. If this is the reason, would you suggest processing it all in one go (produce raster data cube -> aggregate_spatial() -> fit_class_random_forest() -> predict_random_forest() -> save_result()
)
Error message:
Your openEO batch job failed: OpenEOApiException(status_code=501, code=‘Internal’, message=‘Job j-6f51cbbe0ee94e328aedc68f2bdd016e contains no results of supported type GTiff.’, id=‘no-request’) ID: [1674716812200, 24146]
R-code:
library(sf)
library(openeo)
con = connect(host = "https://openeo.cloud")
login()
p = processes()
ff = list_file_formats()
be_small = list(st_point(c(4.329291, 51.30488)),
st_point(c(4.437202, 51.36415))) |>
st_as_sfc(crs=st_crs(4326)) |>
st_as_sf(id = 1:2) |>
st_transform(st_crs(3035)) |>
st_buffer(20) |>
st_simplify(dTolerance = 2)
extract_data = p$load_result(id = "vito-j-6f51cbbe0ee94e328aedc68f2bdd016e") |>
p$aggregate_spatial(geometries = be_small, reducer = p$max) |>
p$save_result(format = ff$output$JSON)
test_job = create_job(extract_data, "Test Extract from S2 cube")
start_job(test_job)
Graph:
{
"process_graph": {
"load_result_LYWXF2858F": {
"process_id": "load_result",
"arguments": {
"id": "vito-j-6f51cbbe0ee94e328aedc68f2bdd016e"
}
},
"aggregate_spatial_ZLYWF7289H": {
"process_id": "aggregate_spatial",
"arguments": {
"data": {
"from_node": "load_result_LYWXF2858F"
},
"geometries": {
"type": "FeatureCollection",
"name": "file180a8e2ea70",
"features": [
{
"type": "Feature",
"properties": {
"id": 1
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
4.32957706670498,
51.3048939387064
],
[
4.32950895799758,
51.3047631809687
],
[
4.32931317322611,
51.304700852543
],
[
4.32910439980373,
51.3047434642879
],
[
4.3290049334548,
51.3048660550208
],
[
4.32907304086815,
51.3049968130406
],
[
4.32926882655979,
51.3050591418734
],
[
4.32947760127622,
51.3050165298463
],
[
4.32957706670498,
51.3048939387064
]
]
]
}
},
{
"type": "Feature",
"properties": {
"id": 2
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
4.43748846286936,
51.3641636763723
],
[
4.43741996947082,
51.3640329805689
],
[
4.43722379329038,
51.363970831476
],
[
4.4370148510183,
51.3640136349018
],
[
4.43691553728796,
51.3641363173806
],
[
4.43698402939125,
51.3642670134679
],
[
4.43718020649887,
51.3643291629676
],
[
4.43738915006619,
51.3642863592579
],
[
4.43748846286936,
51.3641636763723
]
]
]
}
}
]
},
"reducer": {
"process_graph": {
"max_XNBMR8214N": {
"process_id": "max",
"arguments": {
"data": {
"from_parameter": "data"
},
"ignore_nodata": {
"from_parameter": "context"
}
},
"result": true
}
}
},
"target_dimension": "result"
}
},
"save_result_JJFOT1948T": {
"process_id": "save_result",
"arguments": {
"data": {
"from_node": "aggregate_spatial_ZLYWF7289H"
},
"format": "JSON",
"options": {}
},
"result": true
}
},
"parameters": [],
"returns": {
"schema": {
"type": "boolean"
}
}
}
Thanks for your help!