-
Notifications
You must be signed in to change notification settings - Fork 13
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
extract_covariates_var_time() not compatible w/ {terra} SpatRaster #82
Comments
Thanks for your feedback. I will transition |
Thanks! And yes regarding the second topic. I've written a custom function to do this for my own purposes, so I can add that here if you think it would be helpful as a place to start. |
Thanks @joshcullen, that would be very helpful to get started. |
Here are my internal and wrapper functions for extracting covariates in parallel across IDs. I've also created a reprex below to demonstrate. Hope that helps!
|
@joshcullen the first question should now be addressed in the development version of |
I'm working to extract a set of values for my tracks from 4 raster covariates, where 3 of these must be time-matched. Due to the eventual ending of support for {raster}, I've transitioned much of my analyses to {terra}. While trying to use the
extract_covariates_var_time()
function, I've run into an issue caused byraster::getZ()
. In {terra}, this functionality has been kept, but adjusted (as are many of the other functions from {raster}), via theterra::time()
function instead.Would it be possible to add an
if-else
statement within theextract_covariates_var_time()
function based on whether the class of the object is of type 'RasterStack' or 'RasterBrick' for {raster} and 'SpatRaster' for {terra}? This would provide an automated way to extract covariate values without needing to change the class from a SpatRaster to a RasterStack or RasterBrick.Also, since I am working with monthly raster data, would it be possible to add an argument that extracts covariate values based on the name of a specified column corresponding to the name/time of each raster layer (e.g., year-month) rather than the amount of time before or after the time of the raster layer?
The text was updated successfully, but these errors were encountered: