Commit 47a369c3 authored by Cédric Traizet's avatar Cédric Traizet

ENH: replaced version_proxy::GDALDriverType by GDALDriver

parent 8d94a678
...@@ -59,13 +59,11 @@ namespace version_proxy ...@@ -59,13 +59,11 @@ namespace version_proxy
* Whenever GDALDataset and GDALDriver have to be used to open a * Whenever GDALDataset and GDALDriver have to be used to open a
* vector dataset (or OGRDataSource an OGRSFDriver for gdal 1.x), one * vector dataset (or OGRDataSource an OGRSFDriver for gdal 1.x), one
* should use ogr::version_proxy types GDALDataset and * should use ogr::version_proxy types GDALDataset and
* GDALDriverType. * GDALDriver.
* *
* See function documentation for details. * See function documentation for details.
*/ */
typedef GDALDriver GDALDriverType;
/** /**
* This function opens a file, possibly in read-only mode, and returns * This function opens a file, possibly in read-only mode, and returns
* a dataset. * a dataset.
...@@ -107,7 +105,7 @@ namespace version_proxy ...@@ -107,7 +105,7 @@ namespace version_proxy
* \return NULL if dataset could not be created. * \return NULL if dataset could not be created.
*/ */
OTBGdalAdapters_EXPORT OTBGdalAdapters_EXPORT
GDALDataset * Create(GDALDriverType * driver, const char * name , std::vector< std::string > const & options = std::vector< std::string >() ); GDALDataset * Create(GDALDriver * driver, const char * name , std::vector< std::string > const & options = std::vector< std::string >() );
/** /**
......
...@@ -126,7 +126,7 @@ otb::ogr::DataSource::DataSource() ...@@ -126,7 +126,7 @@ otb::ogr::DataSource::DataSource()
{ {
Drivers::Init(); Drivers::Init();
ogr::version_proxy::GDALDriverType * d = GDALDriver * d =
GetGDALDriverManager()->GetDriverByName("Memory"); GetGDALDriverManager()->GetDriverByName("Memory");
assert(d && "OGR Memory driver not found"); assert(d && "OGR Memory driver not found");
m_DataSource = ogr::version_proxy::Create(d,"in-memory"); m_DataSource = ogr::version_proxy::Create(d,"in-memory");
...@@ -178,7 +178,7 @@ otb::ogr::DataSource::Pointer otb::ogr::DataSource::OpenDataSource(std::string c ...@@ -178,7 +178,7 @@ otb::ogr::DataSource::Pointer otb::ogr::DataSource::OpenDataSource(std::string c
<<simpleFileName<<">."); <<simpleFileName<<">.");
} }
ogr::version_proxy::GDALDriverType * d = GDALDriver * d =
GetGDALDriverManager()->GetDriverByName( driverName ); GetGDALDriverManager()->GetDriverByName( driverName );
if(!d) if(!d)
......
...@@ -73,7 +73,7 @@ void Close(GDALDataset * dataset) ...@@ -73,7 +73,7 @@ void Close(GDALDataset * dataset)
#endif #endif
} }
GDALDataset * Create(GDALDriverType * driver, const char * name , std::vector< std::string > const & options ) GDALDataset * Create(GDALDriver * driver, const char * name , std::vector< std::string > const & options )
{ {
#if GDAL_VERSION_NUM<2000000 #if GDAL_VERSION_NUM<2000000
(void)options; (void)options;
...@@ -97,7 +97,7 @@ bool Delete(const char * name) ...@@ -97,7 +97,7 @@ bool Delete(const char * name)
{ {
// Open dataset // Open dataset
GDALDataset * poDS = otb::ogr::version_proxy::Open(name,false); GDALDataset * poDS = otb::ogr::version_proxy::Open(name,false);
GDALDriverType * poDriver = NULL; GDALDriver * poDriver = NULL;
if(poDS) if(poDS)
{ {
poDriver = poDS->GetDriver(); poDriver = poDS->GetDriver();
......
...@@ -1036,7 +1036,7 @@ std::vector<OGRLayer*> OGRIOHelper ...@@ -1036,7 +1036,7 @@ std::vector<OGRLayer*> OGRIOHelper
if (inMemoryDataSource == nullptr) if (inMemoryDataSource == nullptr)
{ {
const char * driverName = "Memory"; const char * driverName = "Memory";
ogr::version_proxy::GDALDriverType * ogrDriver = GetGDALDriverManager()->GetDriverByName(driverName); GDALDriver * ogrDriver = GetGDALDriverManager()->GetDriverByName(driverName);
inMemoryDataSource = ogr::version_proxy::Create(ogrDriver,"tempDataSource"); inMemoryDataSource = ogr::version_proxy::Create(ogrDriver,"tempDataSource");
} }
......
...@@ -215,7 +215,7 @@ void OGRVectorDataIO::Write(const itk::DataObject* datag, char ** /** unused */) ...@@ -215,7 +215,7 @@ void OGRVectorDataIO::Write(const itk::DataObject* datag, char ** /** unused */)
//Find first the OGR driver //Find first the OGR driver
ogr::version_proxy::GDALDriverType * ogrDriver = GDALDriver * ogrDriver =
GetGDALDriverManager()->GetDriverByName(this->GetOGRDriverName(this->m_FileName).data()); GetGDALDriverManager()->GetDriverByName(this->GetOGRDriverName(this->m_FileName).data());
if (ogrDriver == nullptr) if (ogrDriver == nullptr)
......
...@@ -1728,10 +1728,10 @@ int TestHelper::RegressionTestOgrFile(const char *testOgrFilename, const char *b ...@@ -1728,10 +1728,10 @@ int TestHelper::RegressionTestOgrFile(const char *testOgrFilename, const char *b
/* Open data source. */ /* Open data source. */
/* -------------------------------------------------------------------- */ /* -------------------------------------------------------------------- */
GDALDataset *ref_poDS = nullptr; GDALDataset *ref_poDS = nullptr;
otb::ogr::version_proxy::GDALDriverType * ref_poDriver = nullptr; GDALDriver * ref_poDriver = nullptr;
//OGRGeometry * ref_poSpatialFilter = NULL; //OGRGeometry * ref_poSpatialFilter = NULL;
GDALDataset *test_poDS = nullptr; GDALDataset *test_poDS = nullptr;
otb::ogr::version_proxy::GDALDriverType * test_poDriver = nullptr; GDALDriver * test_poDriver = nullptr;
//OGRGeometry * test_poSpatialFilter = NULL; //OGRGeometry * test_poSpatialFilter = NULL;
ref_poDS = otb::ogr::version_proxy::Open(ref_pszDataSource, false); ref_poDS = otb::ogr::version_proxy::Open(ref_pszDataSource, false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment