Skip to content

Commit

Permalink
Apply option for null conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
brownag committed Mar 13, 2024
1 parent 0641219 commit 5b71a2a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/tar-terra-rast.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ tar_terra_rast <- function(name,

# could pull defaults from geotargets package options
if (is.null(filetype)) {
filetype <- "GTiff"
filetype <- geotargets::geotargets_option_get("raster.gdal_driver_name")
}

if (is.null(gdal)) {
gdal <- "ENCODING=UTF-8"
gdal <- geotargets::geotargets_option_get("raster.gdal_creation_options")
}

targets::tar_target_raw(
Expand Down Expand Up @@ -108,7 +108,7 @@ create_format_terra_raster <- function(filetype, gdal, ...) {
drv <- drv[drv$type == "raster" & grepl("write", drv$can), ]

if (is.null(filetype)) {
filetype <- "GTiff"
filetype <- geotargets::geotargets_option_get("raster.gdal_driver_name")
}

filetype <- match.arg(filetype, drv$name)
Expand Down

0 comments on commit 5b71a2a

Please sign in to comment.