Go to the documentation of this file. 43 #ifndef __OPENFLUID_UTILS_GDALCOMPATIBILITY_HPP__ 44 #define __OPENFLUID_UTILS_GDALCOMPATIBILITY_HPP__ 50 #if !defined(GDAL_VERSION_MAJOR) 51 #error "GDAL_VERSION_MAJOR not defined" 58 #if (GDAL_VERSION_MAJOR >= 2) 59 #define GDALAllRegister_COMPAT() GDALAllRegister() 61 #define GDALAllRegister_COMPAT() OGRRegisterAll() 68 #if (GDAL_VERSION_MAJOR >= 2) 69 #define GDALDataset_COMPAT GDALDataset 71 #define GDALDataset_COMPAT OGRDataSource 78 #if (GDAL_VERSION_MAJOR >= 2) 79 #define GDALDriver_COMPAT GDALDriver 81 #define GDALDriver_COMPAT OGRSFDriver 90 #if (GDAL_VERSION_MAJOR >= 2) 91 #define GDALOpenRW_COMPAT(_M_path) \ 92 static_cast<GDALDataset_COMPAT*>(GDALOpenEx(_M_path,GDAL_OF_VECTOR | GDAL_OF_UPDATE,nullptr,nullptr,nullptr)); 94 #define GDALOpenRW_COMPAT(_M_path) OGRSFDriverRegistrar::Open(_M_path,true); 103 #if (GDAL_VERSION_MAJOR >= 2) 104 #define GDALOpenRO_COMPAT(_M_path) \ 105 static_cast<GDALDataset_COMPAT*>(GDALOpenEx(_M_path,GDAL_OF_VECTOR | GDAL_OF_READONLY,nullptr,nullptr,nullptr)); 107 #define GDALOpenRO_COMPAT(_M_path) OGRSFDriverRegistrar::Open(_M_path,false); 115 #if (GDAL_VERSION_MAJOR >= 2) 116 #define GDALFlush_COMPAT(_M_dataset) _M_dataset->FlushCache() 118 #define GDALFlush_COMPAT(_M_dataset) _M_dataset->SyncToDisk() 129 #if (GDAL_VERSION_MAJOR >= 2) 130 #define GDALCopy_COMPAT(_M_driver,_M_srcptr,_M_destpath) \ 131 _M_driver->CreateCopy(_M_destpath,_M_srcptr,false,nullptr,nullptr,nullptr) 133 #define GDALCopy_COMPAT(_M_driver,_M_srcptr,_M_destpath) \ 134 _M_driver->CopyDataSource(_M_srcptr,_M_destpath, nullptr); 144 #if (GDAL_VERSION_MAJOR >= 2) 145 #define GDALCreate_COMPAT(_M_driver,_M_path) \ 146 _M_driver->Create(_M_path,0,0,0,GDT_Unknown,nullptr) 148 #define GDALCreate_COMPAT(_M_driver,_M_path) \ 149 _M_driver->CreateDataSource(_M_path, nullptr); 157 #if (GDAL_VERSION_MAJOR >= 2) 158 #define GDALClose_COMPAT(_M_ptr) GDALClose(_M_ptr); 160 #define GDALClose_COMPAT(_M_ptr) OGRDataSource::DestroyDataSource(_M_ptr); 169 #if (GDAL_VERSION_MAJOR >= 2) 170 #define GDALDelete_COMPAT(_M_driver,_M_path) _M_driver->Delete(_M_path) 172 #define GDALDelete_COMPAT(_M_driver,_M_path) _M_driver->DeleteDataSource(_M_path) 181 #if (GDAL_VERSION_MAJOR >= 2) 182 #define GDALGetDriverByName_COMPAT(_M_name) GetGDALDriverManager()->GetDriverByName(_M_name) 184 #define GDALGetDriverByName_COMPAT(_M_name) OGRSFDriverRegistrar::GetRegistrar()->GetDriverByName(_M_name) 193 #if (GDAL_VERSION_MAJOR >= 2) 194 #define GDALGetDriverName_COMPAT(_M_driver) _M_driver->GetDescription() 196 #define GDALGetDriverName_COMPAT(_M_driver) _M_driver->GetName() 203 #if (GDAL_VERSION_MAJOR >= 2) 204 #define GDALOFTInteger64_COMPAT OFTInteger64 205 #define GDALOFTIntegerList64_COMPAT OFTIntegerList64 207 #define GDALOFTInteger64_COMPAT OFTInteger 208 #define GDALOFTIntegerList64_COMPAT OFTIntegerList