Go to the documentation of this file. 44 #ifndef __OPENFLUID_UTILS_GDALCOMPATIBILITY_HPP__ 45 #define __OPENFLUID_UTILS_GDALCOMPATIBILITY_HPP__ 51 #if !defined(GDAL_VERSION_MAJOR) 52 #error "GDAL_VERSION_MAJOR not defined" 59 #if (GDAL_VERSION_MAJOR >= 2) 60 #define GDALAllRegister_COMPAT() GDALAllRegister() 62 #define GDALAllRegister_COMPAT() OGRRegisterAll() 69 #if (GDAL_VERSION_MAJOR >= 2) 70 #define GDALDataset_COMPAT GDALDataset 72 #define GDALDataset_COMPAT OGRDataSource 79 #if (GDAL_VERSION_MAJOR >= 2) 80 #define GDALDriver_COMPAT GDALDriver 82 #define GDALDriver_COMPAT OGRSFDriver 91 #if (GDAL_VERSION_MAJOR >= 2) 92 #define GDALOpenRW_COMPAT(_M_path) \ 93 static_cast<GDALDataset_COMPAT*>(GDALOpenEx(_M_path,GDAL_OF_VECTOR | GDAL_OF_UPDATE,nullptr,nullptr,nullptr)); 95 #define GDALOpenRW_COMPAT(_M_path) OGRSFDriverRegistrar::Open(_M_path,true); 104 #if (GDAL_VERSION_MAJOR >= 2) 105 #define GDALOpenRO_COMPAT(_M_path) \ 106 static_cast<GDALDataset_COMPAT*>(GDALOpenEx(_M_path,GDAL_OF_VECTOR | GDAL_OF_READONLY,nullptr,nullptr,nullptr)); 108 #define GDALOpenRO_COMPAT(_M_path) OGRSFDriverRegistrar::Open(_M_path,false); 119 #if (GDAL_VERSION_MAJOR >= 2) 120 #define GDALCopy_COMPAT(_M_driver,_M_srcptr,_M_destpath) \ 121 _M_driver->CreateCopy(_M_destpath,_M_srcptr,false,nullptr,nullptr,nullptr) 123 #define GDALCopy_COMPAT(_M_driver,_M_srcptr,_M_destpath) \ 124 _M_driver->CopyDataSource(_M_srcptr,_M_destpath, nullptr); 134 #if (GDAL_VERSION_MAJOR >= 2) 135 #define GDALCreate_COMPAT(_M_driver,_M_path) \ 136 _M_driver->Create(_M_path,0,0,0,GDT_Unknown,nullptr) 138 #define GDALCreate_COMPAT(_M_driver,_M_path) \ 139 _M_driver->CreateDataSource(_M_path, nullptr); 147 #if (GDAL_VERSION_MAJOR >= 2) 148 #define GDALClose_COMPAT(_M_ptr) GDALClose(_M_ptr); 150 #define GDALClose_COMPAT(_M_ptr) OGRDataSource::DestroyDataSource(_M_ptr); 159 #if (GDAL_VERSION_MAJOR >= 2) 160 #define GDALDelete_COMPAT(_M_driver,_M_path) _M_driver->Delete(_M_path) 162 #define GDALDelete_COMPAT(_M_driver,_M_path) _M_driver->DeleteDataSource(_M_path) 171 #if (GDAL_VERSION_MAJOR >= 2) 172 #define GDALGetDriverByName_COMPAT(_M_name) GetGDALDriverManager()->GetDriverByName(_M_name) 174 #define GDALGetDriverByName_COMPAT(_M_name) OGRSFDriverRegistrar::GetRegistrar()->GetDriverByName(_M_name)