Commit 33179fa7 authored by Antoine Regimbeau's avatar Antoine Regimbeau

REFAC: change signature of CopyLayer method, change in API

parent 48f48bdf
......@@ -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
......
......@@ -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 <"
......
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