495 {
496 char *vsi_options_str =
rtoptions(
"gdal_vsi_options");
497
498
499 if (vsi_options_str && strlen(vsi_options_str) > 0) {
500 size_t sz;
502 rtinfo(
"postgis.gdal_vsi_options is set");
503 memset(olist, 0, sizeof(olist));
506 if (sz % 2 == 0) {
507 size_t i;
508 for (i = 0; i < sz; i += 2)
509 {
510 char *key = olist[i];
511 char *val = olist[i+1];
512
513
514 if (strcmp(key, "gdal_skip") == 0) {
515 rtwarn(
"Unable to set GDAL_SKIP config option");
516 continue;
517 }
518 rtinfo(
"CPLSetConfigOption(%s)", key);
519 CPLSetConfigOption(key, val);
520 }
521 }
522 }
523
524 unsigned int open_flags;
525 assert(NULL != fn);
526
529 rterror(
"rt_util_gdal_open: Cannot open file. All GDAL drivers disabled");
530 return NULL;
531 }
533
534 }
535 else if (
536 (strstr(fn, "/vsi") != NULL) &&
537 (strstr(fn, "/vsimem") == NULL) &&
539 ) {
541 return NULL;
542 }
543 }
544
545 open_flags = GDAL_OF_RASTER
546 | GDAL_OF_VERBOSE_ERROR
547 | (fn_access == GA_Update ? GDAL_OF_UPDATE : 0)
548 | (shared ? GDAL_OF_SHARED : 0);
549
550 return GDALOpenEx(fn ,
551 open_flags,
552 NULL,
553 NULL,
554 NULL
555 );
556}
void rterror(const char *fmt,...) __attribute__((format(printf
Wrappers used for reporting errors and info.
void void rtinfo(const char *fmt,...) __attribute__((format(printf
void void void rtwarn(const char *fmt,...) __attribute__((format(printf
void void void char * rtoptions(const char *varname)
Wrappers used for options.
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