Open-EO / openeo-wcps-driver

A prototype implementation for WC(P)S backends
Apache License 2.0
4 stars 0 forks source link

OGC Coverage returned instead of GTiff when running a process graph with a R UDF #40

Open flahn opened 4 years ago

flahn commented 4 years ago

Thanks for the updates on https://github.com/Open-EO/openeo-usecases/issues#1. When I run my simple example, I get results, which is good. But the returned value is a OGC Coverage instead of a TIFF (despite using save_result with "GTiff").

I don't know, do you know of this problem? Is this intended or work in progress?

flahn commented 4 years ago

@prateekbudhwar or @przell any update on this? Together with WUR we tried it again with the same outcome.

przell commented 4 years ago

We know that we have some limitations still. We will check the exact behavior tomorrow. Sorry for the delay but we're sidetracked by some network issues that affect our institute. Thanks for testing and reporting!

ghost commented 4 years ago

Can you send us the process graph that you are using ?

flahn commented 4 years ago

POST https://openeo.eurac.edu/result

{
    "process_graph": {
        "load_collection_NNIXK0215S": {
            "process_id": "load_collection",
            "arguments": {
                "temporal_extent": [
                    "2018-06-04T00:00:00Z",
                    "2018-06-23T00:00:00Z"
                ],
                "spatial_extent": {
                    "west": 11.2792,
                    "south": 46.4643,
                    "east": 11.4072,
                    "north": 46.5182
                },
                "id": "openEO_S2_32632_10m_L2A",
                "bands": null,
                "properties": null
            }
        },
        "run_udf_EOOOE1507G": {
            "process_id": "run_udf",
            "arguments": {
                "data": {
                    "from_node": "load_collection_NNIXK0215S"
                },
                "udf": "# @require x:stars\nlibrary(bfast)\n# set_fast_options()\n\n# Define the pixel-wise function\nSpatialBFM = function(pixels)\n{\n  lsts = ts(pixels, c(1981, 7), frequency=24)\n  bfastmonitor(lsts, 2010)$breakpoint\n}\nStarsResult = st_apply(x, c(\"x\", \"y\"), SpatialBFM, PROGRESS=TRUE)\nStarsResult",
                "context": {

                },
                "runtime": "R",
                "version": null
            }
        },
        "save_result_LQNDY7186S": {
            "process_id": "save_result",
            "arguments": {
                "data": {
                    "from_node": "run_udf_EOOOE1507G"
                },
                "format": "GTiff",
                "options": {

                }
            },
            "result": true
        }
    }
}
przell commented 4 years ago

We have identified the problem. In the r-client script (e.g. the wageningen use case: https://github.com/Open-EO/openeo-usecases/issues/1) please do not use the function compute_results() since udf's only work on batch jobs (not on synchronous jobs). Instead please use the following:

job_id = create_job(con = eurac, graph = graph, title = "enter_title", description = "enter_description")
start_job(con = eurac, job = job_id)
done = download_results(job = job_id, folder = "path_fo_folder")

Thanks to @prateekbudhwar, @aljacob, @flahn for finding this together.

GreatEmerald commented 4 years ago

Note that the backend should give some meaningful error if compute_results() is not supported, rather than an XML with the original data as an output.