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

Crop() function: add geometry alignment control "snap" [feature extension] #593

Open
Rapsodia86 opened this issue Jan 24, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@Rapsodia86
Copy link

As requested, I am opening this issue asking for an additional geometry keyword in the crop() function. This request is a follow-up of the #557 issue.
The crop() function has an option touches: true or false. Whether to use Touches wraper on the object extent. When lines need to be included in e.g. zonal statistics, true should be used. (https://rafaqz.github.io/Rasters.jl/dev/reference/#Rasters.crop)

To make it more consistent with other methods (e.g., crop() in R terra package https://rdrr.io/cran/terra/man/crop.html)/ or just to add option I propose adding alignment control like snap that has :in, :out, and :near (or :center), and keep touches for masking (If TRUE, all cells touched by lines or polygons will be masked, not just those on the line render path, or FALSE for whose center point/centroid is within the polygon).

Thanks!

@rafaqz
Copy link
Owner

rafaqz commented Jan 24, 2024

Thankyou!! Very clear

@Rapsodia86
Copy link
Author

Hello,
Just wanted to remind about this:)

@rafaqz
Copy link
Owner

rafaqz commented May 19, 2024

Ok this will be trivially possible when I get this merged in DD
rafaqz/DimensionalData.jl#717

Wasn't so easy to select ranges with Near without that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants