Open-EO / openeo-pg-parser-python

A python parser for openEO process graphs
Apache License 2.0
1 stars 6 forks source link

ambiguous x value for collection properties in parsed graph ? #25

Closed kempenep closed 4 years ago

kempenep commented 4 years ago

I was wondering how to deal with the following situation. When filtering collections based on properties like cloud cover, we can add the following within the node for load_collection

"eo:cloud_cover": {
    "process_graph": {
        "cc": {
            "process_id": "between",
            "arguments": {
                "x": {
                    "from_parameter": "value"
                },
                "min": 0,
                "max": 70
            },
            "result": true
        }
    }

The between process_id is then parsed with the x argument set to from_node pointing to load_collection:

Node ID: cc_8 
Node Name: cc 
{'arguments': {'max': 70, 'min': 0, 'x': {'from_node': 'dc_6'}},
 'process_id': 'between',
 'result': True}

How we can know from this parsed node to which property of dc_6 this x is referring to? There might as well be another property that we wanted to filter, or do I miss something here?

lforesta commented 4 years ago

I did not work yet with using properties with load_collection, so I'm not sure. Hopefully @claxn can help?

claxn commented 4 years ago

@kempenep Sorry for the late reply. There are two things:

  1. The behaviour that "from_parameter": "value" is replaced by "from_node": "dc_6" was reverted now, because this was based on non-general assumptions of node relationships (see https://github.com/Open-EO/openeo-pg-parser-python/pull/29). Now taking the correct node and its data as input needs to be solved by the back-end, but still can be done easily with the functions the pg parser provides.
  2. The back-end needs to solve to what "x" refers to, basically it is a placeholder for all values contained in "eo:cloud_cover", which is an attribute of the collection (@m-mohr is this right?). The parser will simply tell you that there are 2 nodes "dc_6" and "cc_8" linked via two edges "dc_6" <-"process"- "cc_8" and "dc_6" -"data"-> "cc_8".

Does this answer your question? If yes, please close this issue, thanks!

m-mohr commented 4 years ago

Yeah, correct. You basically run the generated "process" on all values and the one's that succeed will be loaded...