Closed bniebuhr closed 2 years ago
Yes, this is on my to-do list for a while. Did you experience significant speed increases?
I haven't used it enough to test the difference in speed, my comment is more based on the authors (@rhijmans) comments on that... But I am currently trying this, I guess soon I may make some tests and I come back here to comment.
Here are some tests on that by anyone else: https://tmieno2.github.io/R-as-GIS-for-Economists/extract-speed.html
Maybe it is worth also thinking about the possibility of using exact_extract()
?
In any case, I'll try implementing this (at least the terra
approach) in some way and we can work on that.
I have just forked and cloned the repo, but I cannot read the raster sh_forest
to transform it into a terra::rast object. Is it hidden in the package building? The file data/sh_forest.rda
makes reference to the raster data/sh_forest.tif
, but I guess it is probably not uploaded to the Github repo because it is a large file. I'll need it to have a terra version of the object.
What would be the best way to proceed with this?
I made an implementation for this, maybe it could be tested? I am not sure what would be the best way to test the speed of the approaches with the data we have in hands...
PS: the issue with the tif
file above is not important. There was a warning raised but I could successfully transform the raster into a SpatRast
object from the terra
package.
Hi!
I was wondering that it could be desirable to have a support for
SpatRast
objects from theterra
package in the functionamt::extract_covariates
.terra
is equivalent but faster thanraster
, so it would be nice to be able to use it for the same purpose here.The function in
terra
seems to be the same,terra::extract
, even though maybe the input must be aSpatVect
object. In any way, I think it may be easy to implement theextract_covarieates
for it.Do you think about an improvement in this direction?