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

Add a buffer arguments in split_on_poly and crop_on_poly functions #29

Open
LucieContamin opened this issue Nov 27, 2018 · 2 comments
Open

Comments

@LucieContamin
Copy link
Member

Would it be interesting to add a buffer arguments in the split_on_poly and crop_on_poly functions, to be able to select all the value of the raster even the cells that overlap with the polygon?

@choisy
Copy link
Member

choisy commented Nov 27, 2018

Sure! Can you please provide example raster and polygon?

@LucieContamin
Copy link
Member Author

For example, if you run this code, you will see that on the border of Vietnam, we have some missing value.

vn <- sptools::gadm("Vietnam", "sf", 0)
vn <- sf::as_Spatial(vn)
r <- raster::getData("worldclim", var = "tmin", res = 10, lon = 104, lat = 11)
cropr <- sptools::crop_on_poly(r[[1]], vn)
sp::plot(cropr)
sp::plot(vn, add = 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