394 char *vsi_options_str =
rtoptions(
"gdal_vsi_options");
397 if (vsi_options_str && strlen(vsi_options_str) > 0) {
400 rtinfo(
"postgis.gdal_vsi_options is set");
401 memset(olist, 0,
sizeof(olist));
406 for (i = 0; i < sz; i += 2)
408 char *key = olist[i];
409 char *val = olist[i+1];
412 if (strcmp(key,
"gdal_skip") == 0) {
413 rtwarn(
"Unable to set GDAL_SKIP config option");
416 rtinfo(
"CPLSetConfigOption(%s)", key);
417 CPLSetConfigOption(key, val);
422 unsigned int open_flags;
427 rterror(
"rt_util_gdal_open: Cannot open file. All GDAL drivers disabled");
434 (strstr(fn,
"/vsi") != NULL) &&
435 (strstr(fn,
"/vsimem") == NULL) &&
443 open_flags = GDAL_OF_RASTER
444 | GDAL_OF_VERBOSE_ERROR
445 | (fn_access == GA_Update ? GDAL_OF_UPDATE : 0)
446 | (shared ? GDAL_OF_SHARED : 0);
448 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