PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ test_util_gdal_open()

static void test_util_gdal_open ( )
static

Definition at line 111 of file raster/test/cunit/cu_misc.c.

111 {
112 extern char *gdal_enabled_drivers;
113
114 GDALDatasetH ds;
115
116 char *disable_all = GDAL_DISABLE_ALL;
117 char *enabled = "GTiff JPEG PNG";
118 // char *enabled_vsi = "GTiff JPEG PNG VSICURL";
119
121
122 /* all drivers disabled */
123 gdal_enabled_drivers = disable_all;
124 ds = rt_util_gdal_open("/tmp/foo", GA_ReadOnly, 0);
125 CU_ASSERT(ds == NULL);
126
127 /* can't test VSICURL if HTTP driver not found */
129 return;
130
131 /* enabled drivers, no VSICURL */
132 gdal_enabled_drivers = enabled;
133 ds = rt_util_gdal_open("/vsicurl/http://download.osgeo.org/gdal/data/gtiff/small_world.tif", GA_ReadOnly, 0);
134 CU_ASSERT(ds == NULL);
135
136 /* enabled drivers with VSICURL */
137 /* disabled as we don't want network access as a requirement */
138 // gdal_enabled_drivers = enabled_vsi;
139 // ds = rt_util_gdal_open("/vsicurl/http://download.osgeo.org/gdal/data/gtiff/small_world.tif", GA_ReadOnly, 0);
140 // CU_ASSERT(ds != NULL);
141 // GDALClose(ds);
142
143}
int rt_util_gdal_register_all(int force_register_all)
Definition rt_util.c:444
GDALDatasetH rt_util_gdal_open(const char *fn, GDALAccess fn_access, int shared)
Definition rt_util.c:491
int rt_util_gdal_driver_registered(const char *drv)
Definition rt_util.c:463
#define GDAL_DISABLE_ALL
Definition librtcore.h:2240
char * gdal_enabled_drivers
Definition rt_util.c:483

References GDAL_DISABLE_ALL, gdal_enabled_drivers, rt_util_gdal_driver_registered(), rt_util_gdal_open(), and rt_util_gdal_register_all().

Referenced by misc_suite_setup().

Here is the call graph for this function:
Here is the caller graph for this function: