Open Aariq opened 1 month ago
ah ok, I've gotten this to work by using tarchetypes::tar_files()
for the rast_tiles
target, but there's still a question of what role geotargets
has in making this all work. Is there a need for some kind of tar_terra_tiles()
function that is a target factory similar to tarchetypes::tar_files()
but with a custom format supplied?
I like the idea of dedicated functions for working with tiling. Over the weekend I tried a targets wrapper around terra::vrt() which can help with managing the tiles, I could definitely see something like that, which facilitates working with dynamically branched spatraster targets
Update: tar_files()
is probably not the right approach because the upstream target (the one that does the work, in this case) is always re-run. So while this works, it means that the tile creation step always runs when the pipeline is run—definitely not idea. So it does seem like a custom geotargets
function would be nice here. I also tried using vrt()
for this problem, but in this case I couldn't use it because I needed to use app()
on it downstream and app()
doesn't work on vrts.
I'm working with a large SpatRaster and running out of memory trying to do pixel-wise computations on the whole thing, so I'm thinking the best thing to do is to split it into tiles with
makeTiles()
, then (ideally) work on each tile with dynamic branching and re-combine the results. I'm having trouble getting this to work though, and not sure what pieces of this should be handled bygeotargets
. Here's what I've got so far:Created on 2024-05-14 with reprex v2.1.0
I'm not sure how to make
rast_tiles
also be a pattern here.This is somewhat related to #53