Skip to content

Creating a tar_format() to work with terra SpatVector objects [help] #1213

Closed Answered by Aariq
Aariq asked this question in Help
Discussion options

You must be logged in to vote

I think I answered my own question. I ended up not saving any SpatVector targets and for my SpatRaster targets I'm using the following format which works with multiple workers:

format_geotiff <- tar_format(
  read = function(path) terra::rast(path),
  write = function(object, path) terra::writeRaster(x = object, filename = path, filetype = "GTiff", overwrite = TRUE),
  marshal = function(object) terra::wrap(object),
  unmarshal = function(object) terra::unwrap(object)
)

The resulting targets are quite large, but there is no avoiding that, so I'm just trying to make as few targets as possible.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Aariq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant