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

Implementing to_mask for composite regions #73

Open
astrofrog opened this issue Nov 9, 2016 · 0 comments
Open

Implementing to_mask for composite regions #73

astrofrog opened this issue Nov 9, 2016 · 0 comments

Comments

@astrofrog
Copy link
Member

PR #71 adds to_mask for some of the single regions, but in future we'll need to implement it on Compound regions. This will have varying degrees of difficulty depending on the mode:

  • mode='center' - should be easy to implement using boolean operations

  • mode='subpixel' and mode='exact' - this is more complex because if you get two mask pixels that have values of 0.5 for example, it's not clear whether that 0.5 fraction is the same for the two regions in a compound region. If the compound region is a union, the final result could be anywhere from 0.5 to 1.0. There are different possible solutions here. One of them would be to simply convert the compound region to a polygon region (which would need to support multiple disjointed polygons) and then use to_mask on the polygon region class.

This issue is meant to be a space for brainstorming about this, so just add a comment if you have other ideas on how to do this properly.

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