Commit 570807bf authored by Cédric Traizet's avatar Cédric Traizet

ENH: remove version_proxy::GetDriverByName

parent 0cf627bb
......@@ -122,21 +122,6 @@ namespace version_proxy
OTBGdalAdapters_EXPORT
bool Delete(const char * name);
/**
* This function returns a pointer to the driver from its name.
*
* Calls OGRSFDriverRegistrar::GetRegistrar()->GetDriverByName() for
* gdal 1.x implementation and
* GetGDALDriverManager()->GetDriverByName() for gdal 2.x
* implementation.
*
* \param name Name of the driver to retrieve
*
* \return NULL if no driver could be retrieved.
*/
OTBGdalAdapters_EXPORT
GDALDriverType * GetDriverByName(const char * name);
/**
* Return the list of files composing the dataset.
*
......
......@@ -127,7 +127,7 @@ otb::ogr::DataSource::DataSource()
Drivers::Init();
ogr::version_proxy::GDALDriverType * d =
ogr::version_proxy::GetDriverByName("Memory");
GetGDALDriverManager()->GetDriverByName("Memory");
assert(d && "OGR Memory driver not found");
m_DataSource = ogr::version_proxy::Create(d,"in-memory");
if (!m_DataSource) {
......@@ -179,7 +179,7 @@ otb::ogr::DataSource::Pointer otb::ogr::DataSource::OpenDataSource(std::string c
}
ogr::version_proxy::GDALDriverType * d =
ogr::version_proxy::GetDriverByName( driverName );
GetGDALDriverManager()->GetDriverByName( driverName );
if(!d)
{
......
......@@ -119,15 +119,6 @@ bool Delete(const char * name)
return false;
}
GDALDriverType * GetDriverByName(const char * name)
{
#if GDAL_VERSION_NUM<2000000
return OGRSFDriverRegistrar::GetRegistrar()->GetDriverByName(name);
#else
return GetGDALDriverManager()->GetDriverByName(name);
#endif
}
#if GDAL_VERSION_NUM>=2000000
namespace raii
{
......
......@@ -1036,7 +1036,7 @@ std::vector<OGRLayer*> OGRIOHelper
if (inMemoryDataSource == nullptr)
{
const char * driverName = "Memory";
ogr::version_proxy::GDALDriverType * ogrDriver = ogr::version_proxy::GetDriverByName(driverName);
ogr::version_proxy::GDALDriverType * ogrDriver = GetGDALDriverManager()->GetDriverByName(driverName);
inMemoryDataSource = ogr::version_proxy::Create(ogrDriver,"tempDataSource");
}
......
......@@ -216,7 +216,7 @@ void OGRVectorDataIO::Write(const itk::DataObject* datag, char ** /** unused */)
//Find first the OGR driver
ogr::version_proxy::GDALDriverType * ogrDriver =
ogr::version_proxy::GetDriverByName(this->GetOGRDriverName(this->m_FileName).data());
GetGDALDriverManager()->GetDriverByName(this->GetOGRDriverName(this->m_FileName).data());
if (ogrDriver == nullptr)
{
......
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