PostGIS  2.1.10dev-r@@SVN_REVISION@@
GDALDatasetH rt_util_gdal_open ( const char *  fn,
GDALAccess  fn_access,
int  shared 
)

Definition at line 487 of file rt_api.c.

References GDAL_DISABLE_ALL, GDAL_ENABLE_ALL, gdal_enabled_drivers, GDAL_VSICURL, and rterror().

Referenced by RASTER_addBandOutDB(), RASTER_fromGDALRaster(), rt_band_load_offline_data(), and test_util_gdal_open().

487  {
488  assert(NULL != fn);
489 
490  if (gdal_enabled_drivers != NULL) {
491  if (strstr(gdal_enabled_drivers, GDAL_DISABLE_ALL) != NULL) {
492  rterror("rt_util_gdal_open: Cannot open file. All GDAL drivers disabled");
493  return NULL;
494  }
495  else if (strstr(gdal_enabled_drivers, GDAL_ENABLE_ALL) != NULL) {
496  /* do nothing */
497  }
498  else if (
499  (strstr(fn, "/vsicurl") != NULL) &&
500  (strstr(gdal_enabled_drivers, GDAL_VSICURL) == NULL)
501  ) {
502  rterror("rt_util_gdal_open: Cannot open VSICURL file. VSICURL disabled");
503  return NULL;
504  }
505  }
506 
507  if (shared)
508  return GDALOpenShared(fn, fn_access);
509  else
510  return GDALOpen(fn, fn_access);
511 }
#define GDAL_ENABLE_ALL
Definition: rt_api.h:1975
char * gdal_enabled_drivers
Definition: rt_api.c:481
void rterror(const char *fmt,...)
Raster core error and info handlers.
Definition: rt_api.c:895
#define GDAL_DISABLE_ALL
Definition: rt_api.h:1976
#define GDAL_VSICURL
Definition: rt_api.h:1977

Here is the call graph for this function:

Here is the caller graph for this function: