Open-EO / openeo-web-editor

An interactive and easy to use web-based editor for the OpenEO API.
https://editor.openeo.org
Apache License 2.0
12 stars 17 forks source link

Code sample in R not working for services in namespace #297

Open JanssenBrm opened 1 year ago

JanssenBrm commented 1 year ago

One of our openEO users is using the R client to execute processes. To get started she used the code samples from the openEO Web Editor to execute the following code:

# Import required packages
library(openeo)

# Connect to the back-end
connection = connect(host = "https://openeo.vito.be")
# ToDo: Authentication with login()

p = processes()

yieldpotentialmap_terrascope = p$yieldpotentialmap_terrascope(exclude_months = list(1, 2, 3, 4, 9, 10, 11, 12), exclude_croptypes = list(), polygon = list("type" = "Polygon", "coordinates" = list(list(list(5.170037117570351, 51.250525073249634), list(5.170958174465619, 51.248676084148144), list(5.178569920451582, 51.24674196960879), list(5.179155939642469, 51.24986101801744), list(5.170037117570351, 51.250525073249634)))), date = list("2022-01-01T00:00:00Z", "2022-12-31T00:00:00Z"), namespace = "NULL")

# The process can be executed synchronously (see below), as a batch job or as a web service now
result = compute_result(graph = yieldpotentialmap_terrascope)

She also included the login step and successfully authenticated with EGI Checkin. However, as shown in the screenshot below, the yieldpotentialmap_terrascope is not available. Maybe something is missing to also load in the processes of a specific namespace?

image

I'm not sure whether this is an error on the web client or something that is not yet supported in the R client. Feel free to close the issue if I should open this in the R client repo.

m-mohr commented 1 year ago

Found and fixed a bug in the code generation, but I also think that namespaced processes may not be supported by R yet. So I'm throwing an error explaining that namespaced processes are not supported by R. See also https://github.com/Open-EO/openeo-r-client/issues/143

JanssenBrm commented 1 year ago

In case it is still relevant, the following graph was used:

{
  "process_graph": {
    "yieldpotentialmap_terrascope": {
      "process_id": "yieldpotentialmap_terrascope",
      "namespace": "vito",
      "arguments": {
        "exclude_months": [
          1,
          2,
          3,
          4,
          9,
          10,
          11,
          12
        ],
        "exclude_croptypes": [],
        "polygon": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                5.170037117570351,
                51.250525073249634
              ],
              [
                5.170958174465619,
                51.248676084148144
              ],
              [
                5.178569920451582,
                51.24674196960879
              ],
              [
                5.179155939642469,
                51.24986101801744
              ],
              [
                5.170037117570351,
                51.250525073249634
              ]
            ]
          ]
        },
        "date": [
          "2022-01-01T00:00:00Z",
          "2022-12-31T00:00:00Z"
        ]
      },
      "result": true
    }
  }
}