Returns a set of available GDAL drivers.
1721 GDALDriverH *drv = NULL;
1727 assert(drv_count != NULL);
1730 count = GDALGetDriverCount();
1735 rterror(
"rt_raster_gdal_drivers: Could not allocate memory for gdaldriver structure");
1739 for (i = 0, j = 0; i <
count; i++) {
1740 drv = GDALGetDriver(i);
1742 #ifdef GDAL_DCAP_RASTER
1745 const char *is_raster;
1746 is_raster = GDALGetMetadataItem(drv, GDAL_DCAP_RASTER, NULL);
1747 if (is_raster == NULL || !EQUAL(is_raster,
"YES"))
1752 cc = GDALGetMetadataItem(drv, GDAL_DCAP_CREATECOPY, NULL);
1755 vio = GDALGetMetadataItem(drv, GDAL_DCAP_VIRTUALIO, NULL);
1757 if (can_write && (cc == NULL || vio == NULL))
1763 rtn[j].
can_write = (cc != NULL && vio != NULL);
1765 if (rtn[j].can_write) {
1766 RASTER_DEBUGF(3,
"driver %s (%d) supports CreateCopy() and VirtualIO()", txt, i);
1773 txt = GDALGetDriverShortName(drv);
1774 txt_len = strlen(txt);
1776 txt_len = (txt_len + 1) *
sizeof(
char);
1778 memcpy(rtn[j].short_name, txt, txt_len);
1781 txt = GDALGetDriverLongName(drv);
1782 txt_len = strlen(txt);
1784 txt_len = (txt_len + 1) *
sizeof(
char);
1786 memcpy(rtn[j].long_name, txt, txt_len);
1789 txt = GDALGetDriverCreationOptionList(drv);
1790 txt_len = strlen(txt);
1792 txt_len = (txt_len + 1) *
sizeof(
char);
1794 memcpy(rtn[j].create_options, txt, txt_len);
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
void * rtalloc(size_t size)
Wrappers used for managing memory.
int rt_util_gdal_register_all(int force_register_all)
#define RASTER_DEBUGF(level, msg,...)
void * rtrealloc(void *mem, size_t size)
struct rt_gdaldriver_t * rt_gdaldriver