Rasters.jl
Rasters.jl copied to clipboard
Crop() function: add geometry alignment control "snap" [feature extension]
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!