Returns a set of available GDAL drivers.
1716 GDALDriverH *drv = NULL;
1722 assert(drv_count != NULL);
1725 count = GDALGetDriverCount();
1730 rterror(
"rt_raster_gdal_drivers: Could not allocate memory for gdaldriver structure");
1734 for (i = 0, j = 0; i <
count; i++) {
1735 drv = GDALGetDriver(i);
1737 #ifdef GDAL_DCAP_RASTER
1740 const char *is_raster;
1741 is_raster = GDALGetMetadataItem(drv, GDAL_DCAP_RASTER, NULL);
1742 if (is_raster == NULL || !EQUAL(is_raster,
"YES"))
1747 cc = GDALGetMetadataItem(drv, GDAL_DCAP_CREATECOPY, NULL);
1750 vio = GDALGetMetadataItem(drv, GDAL_DCAP_VIRTUALIO, NULL);
1752 if (can_write && (cc == NULL || vio == NULL))
1758 rtn[j].
can_write = (cc != NULL && vio != NULL);
1760 if (rtn[j].can_write) {
1761 RASTER_DEBUGF(3,
"driver %s (%d) supports CreateCopy() and VirtualIO()", txt, i);
1768 txt = GDALGetDriverShortName(drv);
1769 txt_len = strlen(txt);
1771 txt_len = (txt_len + 1) *
sizeof(
char);
1773 memcpy(rtn[j].short_name, txt, txt_len);
1776 txt = GDALGetDriverLongName(drv);
1777 txt_len = strlen(txt);
1779 txt_len = (txt_len + 1) *
sizeof(
char);
1781 memcpy(rtn[j].long_name, txt, txt_len);
1784 txt = GDALGetDriverCreationOptionList(drv);
1785 txt_len = strlen(txt);
1787 txt_len = (txt_len + 1) *
sizeof(
char);
1789 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