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

Invert mask #103

Closed
soxofaan opened this issue Dec 13, 2019 · 7 comments
Closed

Invert mask #103

soxofaan opened this issue Dec 13, 2019 · 7 comments

Comments

@soxofaan
Copy link
Member

soxofaan commented Dec 13, 2019

The mask process allows polygons to be passed as mask, in which case the pixels covered by the polygons are masked out (replaced with replacement value):

All pixels for which the point at the pixel center intersects with the corresponding polygon (as defined in the Simple Features standard by the OGC) are replaced.

(from https://openeo.org/documentation/0.4/processes.html#mask)

Wouldn't it be useful as well to have an option to flip this behaviour: preserve the pixels that are covered by any of the polygons and replace the "outside" of the polygons. (This would actually be my intuitive expectation of how this process would handle polygons by default)

@m-mohr m-mohr changed the title mask with polygon Invert mask Dec 13, 2019
@m-mohr m-mohr added the help wanted Extra attention is needed label Dec 13, 2019
@m-mohr m-mohr added this to the v1.0 milestone Dec 13, 2019
@m-mohr
Copy link
Member

m-mohr commented Dec 13, 2019

Sounds useful. I guess the parameter should also apply to the other options of mask.

@m-mohr m-mohr added accepted and removed help wanted Extra attention is needed labels Dec 13, 2019
@soxofaan
Copy link
Member Author

indeed (and actually, my intuition would expect that flipped behavior to be the default for raster masks as well, but maybe it's an EO convention I'm not used to yet)

@m-mohr m-mohr added the help wanted Extra attention is needed label Dec 13, 2019
@lforesta
Copy link
Contributor

We could also use the process "not" to invert the mask, but it's a bit clearer if this behavior can be defined directly when calling "mask".

@soxofaan
Copy link
Member Author

We could also use the process "not" to invert the mask,

But that wouldn't work for a polygon (GeoJSON) based mask, right?

@m-mohr
Copy link
Member

m-mohr commented Dec 16, 2019

It would, but with more steps: Create mask from GeoJSON, apply not on all pixels in mask, apply mask on original data.
That's not very intuitive and I agree that there should be a more user-friendly option for it.

m-mohr added a commit that referenced this issue Dec 17, 2019
@m-mohr m-mohr mentioned this issue Dec 17, 2019
@m-mohr
Copy link
Member

m-mohr commented Dec 17, 2019

There's now PR #110 to implement this proposal. @soxofaan

@m-mohr m-mohr added work in progress and removed help wanted Extra attention is needed labels Dec 17, 2019
@m-mohr m-mohr closed this as completed Jan 13, 2020
@m-mohr
Copy link
Member

m-mohr commented Jan 13, 2020

Has been merged. Is now available in mask_polygon.

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

3 participants