Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve meta data filtering on load_collection #102

Closed
flahn opened this issue Dec 7, 2021 · 2 comments
Closed

Improve meta data filtering on load_collection #102

flahn opened this issue Dec 7, 2021 · 2 comments

Comments

@flahn
Copy link
Member

flahn commented Dec 7, 2021

https://discuss.eodc.eu/t/setting-a-cloudfilter-in-load-collections/145

There is a new subtype metadata-filter that is not yet covered. This results in very poor user experience regarding something like filtering scenes in terms of cloud coverage. Maybe @m-mohr can provide some details and examples, how the JSON should look like.

@flahn flahn added the medium label Dec 7, 2021
@m-mohr
Copy link
Member

m-mohr commented Dec 8, 2021

I think overloading the logical operators would be nice if possible. This would allow to get something like:

filter = list(
  "eo:cloud_cover" = function(x) x >= 0 && x < 50, # or function(x, builder) builder$between(x, 0, 50)
  "platform" = function(x) x == "Sentinel-2A"
)

It seems there's already something similar available: https://discuss.eodc.eu/t/generating-a-cloud-mask-using-the-r-client/109/4?u=m-mohr

@m-mohr
Copy link
Member

m-mohr commented Dec 8, 2021

The resulting JSON would be for example:

{
  "eo:cloud_cover": {
    "process_graph": {
      "2": {
        "process_id": "gte",
        "arguments": {
          "x": {
            "from_parameter": "x"
          },
          "y": 0
        }
      },
      "3": {
        "process_id": "lt",
        "arguments": {
          "x": {
            "from_parameter": "x"
          },
          "y": 50
        }
      },
      "4": {
        "process_id": "and",
        "arguments": {
          "x": {
            "from_node": "3"
          },
          "y": {
            "from_node": "2"
          }
        },
        "result": true
      }
    }
  },
  "platform": {
    "process_graph": {
      "1": {
        "process_id": "eq",
        "arguments": {
          "x": {
            "from_parameter": "x"
          },
          "y": "Sentinel-2A"
        },
        "result": true
      }
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants