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