njtierney / geotargets

Targets extensions for geospatial data
https://njtierney.github.io/geotargets/
Other
49 stars 4 forks source link

Linking to documentation for specifying multiple options in `geotargets.gdal.raster.creation_options` #26

Closed njtierney closed 3 months ago

njtierney commented 3 months ago

As asked by @Aariq in #19

Can one supply multiple options? If so, how should they be delimited?

In reference to:

#' ## Available Options
#'
#'  - `"geotargets.gdal.raster.creation_options"` - set the GDAL creation options used when writing raster files to target store (default: `"ENCODING=UTF-8"`)

It might would be useful to discuss how to specify multiple options, and where users can go to find more options to set. E.g., for setting multiple options we could reference this:

geotargets::geotargets_option_set("raster_gdal_creation_options", c("COMPRESS=DEFLATE", "TFW=YES"))

And if we want users to have the capacity to provide multiple options, maybe we point them to https://gdal.org/drivers/raster/gtiff.html#creation-options to list creation options? Is that the right source?

brownag commented 3 months ago

Thanks @Aariq for pointing this out, I had meant to add a blurb to document this then forgot!

For options we can specify a character vector with length >= 1 where each element has form "OPTION=VALUE"

For the system environment variables we don't have the ability to have length > 1, so I hardcoded the use of semicolon as a delimiter, so when Sys.getenv() is called the result is strsplit() using ";". Open to alternatives to the latter, but probably just needs to be documented for now. It may be that we don't really need system environment variables at all, but it may be useful for some folks to be able to do it that way.

RE: the source to reference. This would vary depending on the driver being used, but could certainly give GeoTIFF driver as an example. Other raster drivers may differ in the creation options they support, e.g. https://gdal.org/drivers/raster/netcdf.html#creation-options

njtierney commented 3 months ago

closed in #30