Skip to content

Commit

Permalink
pass gdal opts down to writeRaster (fix for #93)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aariq committed Sep 11, 2024
1 parent 153682a commit f9db9c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/tar-terra-sprc.R
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ format_terra_collections <- function(type = c("sprc", "sds")) {
"sds" = function(path) terra::sds(path)
),
write = function(object, path) {
gdal <- strsplit(
Sys.getenv("GEOTARGETS_GDAL_RASTER_CREATION_OPTIONS",
unset = ";"),
";")[[1]]

for (i in seq(object)) {
if (i > 1) {
opt <- "APPEND_SUBDATASET=YES"
Expand All @@ -318,7 +323,7 @@ format_terra_collections <- function(type = c("sprc", "sds")) {
filename = path,
filetype = Sys.getenv("GEOTARGETS_GDAL_RASTER_DRIVER"),
overwrite = (i == 1),
gdal = opt
gdal = c(opt, gdal)
)
}
},
Expand Down

0 comments on commit f9db9c9

Please sign in to comment.