-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix --config parameter #30
Comments
Same to access /vsis3 files. We need to inform AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in --config parameter and the same error raises. |
@jgrn307 these parameters are kind of a combination between Let me know and I'd be happy to work on the PR. |
I think --config could be a gdalinfo('/vsis3/MyBucketName/MyFileKeyId.tif',
config = c(AWS_ACCESS_KEY_ID='MyAccessKeyIdString',
AWS_SECRET_ACCESS_KEY='MySecretAccessKeyString') This should generate the following command: gdalinfo /vsis3/MyBucketName/MyFileKeyId.tif --config AWS_ACCESS_KEY_ID "MyAccessKeyIdString" --config AWS_SECRET_ACCESS_KEY "MySecretAccessKeyString" The implementation I suggest could be:
gdal_cmd_builder <- function(executable,parameter_variables=c(),
parameter_values=c(), parameter_order=c(), parameter_noflags=c(),
parameter_doubledash=c(),
parameter_noquotes=c(),
parameter_named=c(), # <-- here
gdal_installation_id=1,
python_util=FALSE,
verbose=FALSE)
parameter_variables_character_string <- paste(flag,
qm(parameter_values[[which(names(parameter_values)==X)]]), sep="") by parameter_values_actual <- parameter_values[[which(names(parameter_values) == X)]]
if (X %in% parameter_named && !is.null(names(parameter_values_actual)))
{
parameter_variables_character_string <-
paste(paste(flag, mapply(paste, names(parameter_values_actual),
qm(parameter_values_actual)), sep = " "), collapse = " ")
} else
{
parameter_variables_character_string <-
paste(paste(flag, qm(parameter_values_actual), sep = " "), collapse = " ")
} For completeness, this same code could be inserted in other code sections of the |
in
gdalUtils::gdal_translate()
one can set config parameters using the double-dashed optionconfig
which will be forwarded togdal_translate
.The correct usage of this in gdal would be as a key value pair:
However, gdalUtils calls it as follows, resulting in an error (I am aware that this would result in an error anyways as no file is supplied, yet it would be different).
I think the best way to fix this is to use named chr vectors like this:
The text was updated successfully, but these errors were encountered: