391 char *vsi_options_str =
rtoptions(
"gdal_vsi_options");
394 if (vsi_options_str && strlen(vsi_options_str) > 0) {
397 rtinfo(
"postgis.gdal_vsi_options is set");
398 memset(olist, 0,
sizeof(olist));
403 for (i = 0; i < sz; i += 2)
405 char *key = olist[i];
406 char *val = olist[i+1];
409 if (strcmp(key,
"gdal_skip") == 0) {
410 rtwarn(
"Unable to set GDAL_SKIP config option");
413 rtinfo(
"CPLSetConfigOption(%s)", key);
414 CPLSetConfigOption(key, val);
419 unsigned int open_flags;
424 rterror(
"rt_util_gdal_open: Cannot open file. All GDAL drivers disabled");
431 (strstr(fn,
"/vsi") != NULL) &&
432 (strstr(fn,
"/vsimem") == NULL) &&
440 open_flags = GDAL_OF_RASTER
441 | GDAL_OF_VERBOSE_ERROR
442 | (fn_access == GA_Update ? GDAL_OF_UPDATE : 0)
443 | (shared ? GDAL_OF_SHARED : 0);
445 return GDALOpenEx(fn ,
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
void rtinfo(const char *fmt,...)
char * rtoptions(const char *varname)
Wrappers used for options.
void rtwarn(const char *fmt,...)
size_t option_list_length(char **olist)
Returns the total number of keys and values in the list.
void option_list_parse(char *input, char **olist)
option_list is a null-terminated list of strings, where every odd string is a key and every even stri...
char * gdal_enabled_drivers