diff --git a/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h b/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h index edee98817ae3ecf745ea4d98f1f2301392fe87d7..f3f71a4fba741907ce2caacf718f270cbf3cfd7c 100644 --- a/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h +++ b/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h @@ -370,7 +370,7 @@ public: Layer CopyLayer( Layer & srcLayer, std::string const& newName, - char ** papszOptions = ITK_NULLPTR); + std::vector<std::string> const& papszOptions = std::vector<std::string>() ); //@} /**\name Layers access @@ -550,9 +550,9 @@ private: std::string GetDatasetDescription() const; private: - ogr::version_proxy::GDALDatasetType *m_DataSource; - FileNameHelperType::Pointer m_FileNameHelper; static FileNameHelperType::Pointer staticFileNameHelper; + ogr::version_proxy::GDALDatasetType *m_DataSource; + FileNameHelperType::GDALOptionType m_LayerOptions; Modes::type m_OpenMode; int m_FirstModifiableLayerID; }; // end class DataSource diff --git a/Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx b/Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx index bd30ef8bb64d33eabb5aa052a8b46a1470e74004..c3d7e57326a0ea6b328a8b3f49c076ac60ce07d3 100644 --- a/Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx +++ b/Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx @@ -122,7 +122,6 @@ char const* DeduceDriverName(std::string filename) otb::ogr::DataSource::DataSource() : m_DataSource(ITK_NULLPTR), - m_FileNameHelper(), m_OpenMode(Modes::Update_LayerUpdate), m_FirstModifiableLayerID(0) { @@ -134,7 +133,6 @@ otb::ogr::DataSource::DataSource() if (!m_DataSource) { itkExceptionMacro(<< "Failed to create OGRMemDataSource: " << CPLGetLastErrorMsg()); } - m_FileNameHelper = FileNameHelperType::New(); } otb::ogr::DataSource::DataSource(otb::ogr::version_proxy::GDALDatasetType * source, Modes::type mode) @@ -368,7 +366,7 @@ otb::ogr::Layer otb::ogr::DataSource::CreateLayer( otb::ogr::Layer otb::ogr::DataSource::CopyLayer( Layer & srcLayer, std::string const& newName, - char ** papszOptions/* = NULL */) + std::vector<std::string> const& papszOptions/* = NULL */) { assert(m_DataSource && "Datasource not initialized"); @@ -386,7 +384,7 @@ otb::ogr::Layer otb::ogr::DataSource::CopyLayer( } OGRLayer * l0 = &srcLayer.ogr(); - OGRLayer * ol = m_DataSource->CopyLayer(l0, newName.c_str(), papszOptions); + OGRLayer * ol = m_DataSource->CopyLayer(l0, newName.c_str(), otb::ogr::StringListConverter(papszOptions).to_ogr()); if (!ol) { itkGenericExceptionMacro(<< "Failed to copy the layer <"