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

Force read into memory #113

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Force read into memory #113

wants to merge 2 commits into from

Conversation

Aariq
Copy link
Collaborator

@Aariq Aariq commented Nov 13, 2024

This is a necessary addition to tar_terra_rast() for SpatRaster targets to work with cloud storage. (see more discussion in ropensci/targets#1367). I added a parameter and some documentation, but haven't figured out how to "hook it up" efficiently. When force_memory is true, it needs to modify the body of the read function to add + 0 or * 1 to the end. Tried messing around with body(fun) and rlang::expr() but didn't get anything satisfactory. I'm open to ideas and alternatives!

One alternative is to use the new content addressable storage tools in targets to have a custom download function that doesn't actually download the target, but rather returns a /vsis3/ filepath to the read function. This is not something we'd implement in geotargets, but would be something cool to document in a vignette. I may play around with this in the next few weeks.

@Aariq
Copy link
Collaborator Author

Aariq commented Nov 13, 2024

I actually think documenting the content addressable storage workaround is probably a better way to go, but I'll leave this open for a bit just in case y'all think there might be good reasons to add a force_memory argument.

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

Successfully merging this pull request may close these issues.

1 participant