- Notifications
You must be signed in to change notification settings - Fork6
Use _geotargets cache for files, _targets forPackedSpatRasters#106
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
… metadata - Source data file is written using `terra::wrapCache()` to a user-specified cache directory - Target is created for PackedSpatRaster based on cache - Target is created for cache files - Add cache-managing functions `geotargets_destroy_cache()` and `geotargets_init_cache()`
Co-authored-by: Eric R. Scott <ericrscott@arizona.edu>
Co-authored-by: Eric R. Scott <ericrscott@arizona.edu>
CollaboratorAuthor
Aariq commentedOct 23, 2024
Hmm... now questioning whether this is better than just using zip or tar files (optionally) like in#62. Might need to do some benchmarking to see how much overhead each method adds. If they are similar, then maybe zip/tar files (with low or no compression) are better since it doesn't involve managing a separate cache. |
This was referencedOct 28, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading.Please reload this page.
A slightly different take on#63 that uses an option (currently called
use_cache) to switch on behavior to deal with#58 instead of adding an additionaltar_terra_*()function.When
use_cacheisTRUE, the raster is written withterra::wrapCache()tocache_dir(default_geotargets/) and the output (aPackedSpatRasterobject) is saved to the targets store withsaveRDS(). This allows 'sidecar' files to exist and be read back in by the read function (terra::unwrap(readRDS(path))).I'd love any feedback onnaming things andwhere to document this. E.g. I'm not sure that "cache" is really a good/complete descriptor for what's going on here.
use_external_cache?use_raster_cache?use_proxy_cache?Things to do in other PRs before this one is ready:
tar_target()andtar_target_raw()have been merged intargets(Update parameter documentation #107,custom documentation for name, command, and pattern params #108)Things to do in this PR before it is ready:
document()_geotargets/cache is user-friendly. E.g. when that cache is destroyed (by ageotargetsfunction), the corresponding targets are also invalidated.tar_prune()but for the_geotargets/cache.