diff --git a/R/AAAA.R b/R/AAAA.R index 1a96aa5..e1076a3 100644 --- a/R/AAAA.R +++ b/R/AAAA.R @@ -1,9 +1,9 @@ -# geotargets.env <- new.env() +# geotargets.env <- new.env(parent = emptyenv()) # # geotargets_env <- function() { # geotargets.env # } -.onAttach <- function(lib, pkg) { - geotargets_option_set() -} +# .onAttach <- function(lib, pkg) { +# geotargets_option_set() +# } diff --git a/R/tar-terra-rast.R b/R/tar-terra-rast.R index 2215ae3..a8b319c 100644 --- a/R/tar-terra-rast.R +++ b/R/tar-terra-rast.R @@ -49,6 +49,9 @@ tar_terra_rast <- function(name, retrieval = targets::tar_option_get("retrieval"), cue = targets::tar_option_get("cue")) { + filetype <- filetype %||% "GTiff" + gdal <- gdal %||% "ENCODING=UTF-8" + name <- targets::tar_deparse_language(substitute(name)) envir <- targets::tar_option_get("envir") diff --git a/R/tar-terra-vect.R b/R/tar-terra-vect.R index 9619599..acc06ef 100644 --- a/R/tar-terra-vect.R +++ b/R/tar-terra-vect.R @@ -57,6 +57,10 @@ tar_terra_vect <- function(name, storage = targets::tar_option_get("storage"), retrieval = targets::tar_option_get("retrieval"), cue = targets::tar_option_get("cue")) { + + filetype <- filetype %||% "GeoJSON" + gdal <- gdal %||% "ENCODING=UTF-8" + name <- targets::tar_deparse_language(substitute(name)) envir <- targets::tar_option_get("envir") diff --git a/man/geotargets-options.Rd b/man/geotargets-options.Rd index c7a6099..094480f 100644 --- a/man/geotargets-options.Rd +++ b/man/geotargets-options.Rd @@ -19,7 +19,17 @@ geotargets_option_get(name) data in target store (default: \code{"GTiff"}). Options for driver names can be found here: \url{https://gdal.org/drivers/raster/index.html}} -\item{gdal_raster_creation_options}{character; set the GDAL layer creation +\item{gdal_raster_creation_options}{character; set the GDAL creation options +used when writing raster files to target store (default: \code{""}). You may +specify multiple values e.g. \code{c("COMPRESS=DEFLATE", "TFW=YES")}. Each GDAL +driver supports a unique set of creation options. For example, with the +default \code{"GTiff"} driver: +\url{https://gdal.org/drivers/raster/gtiff.html#creation-options}} + +\item{gdal_vector_driver}{character, length 1; set the file type used for +vector data in target store (default: \code{"GeoJSON"}).} + +\item{gdal_vector_creation_options}{character; set the GDAL layer creation options used when writing vector files to target store (default: \code{"ENCODING=UTF-8"}). You may specify multiple values e.g. \code{c("WRITE_BBOX=YES", "COORDINATE_PRECISION=10")}. Each GDAL driver supports @@ -27,9 +37,6 @@ a unique set of creation options. For example, with the default \code{"GeoJSON"} driver: \url{https://gdal.org/drivers/vector/geojson.html#layer-creation-options}} -\item{gdal_vector_driver}{character, length 1; set the file type used for -vector data in target store (default: \code{"GeoJSON"}).} - \item{name}{character; option name to get} } \description{