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

replacement value in masking processes #291

Closed metzm closed 1 year ago

metzm commented 1 year ago

With the web editor it is possible to define a ?number|boolean|string|null replacement = null value for the mask_polygon process as

        "replacement": {
          "unnamed0": "null()",
          "unnamed1": 10,
          "unnamed2": null,
          "null": "notnull",
          "unnamed4": false
        },
  1. There should be only one value allowed, not several values.
  2. Instead of a key-value pair I would expect something like "replacement": 10 or "replacement": false or "replacement": null.

It seems that in mask_polygon

            "name": "replacement",
            "description": "The value used to replace masked values with.",
            "schema": [
                {
                    "type": "number"
                },
                {
                    "type": "boolean"
                },
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],

needs to be replaced with

            "name": "replacement",
            "description": "The value used to replace masked values with.",
            "schema": {
                "type": [
                    "number",
                    "boolean",
                    "string",
                    "null"
                ]
            },

as in mask

Update The same issue applies to the mask process in the web editor.

m-mohr commented 1 year ago

Hi @metzm,

on the VITO back-end I can't reproduce this, but on the mundialis back-end I can. The issue is that the mundialis back-end returns another schema for the replacement value ({ "subtype": "string", "type": "object" }), which is different from the original schema and the schema you posted here. Not sure where the other schema comes from, but it's wrong and must be fixed on the back-end side, the editor handles the object correctly.

PS: The schemas that you've posted are equivalent.