Commit aef1745f authored by Julien Michel's avatar Julien Michel

COMP: Adding a new method in the version proxy to wrap the...

COMP: Adding a new method in the version proxy to wrap the GetDriver()->GetName() code, and use it in Segmentation application
parent 63aa0761
......@@ -126,6 +126,9 @@ namespace version_proxy
*/
GDALDriverType * GetDriverByName(const char * name);
std::string GetDriverNameFromDataSource(const GDALDatasetType * ds);
/**
* Sync dataset to disk.
*
......
......@@ -119,6 +119,11 @@ std::vector<std::string> GetAvailableDriversAsStringVector()
return ret;
}
std::string GetDriverNameFromDataSource(const GDALDatasetType * ds)
{
return std::string(const_cast<GDALDatasetType *>(ds)->GetDriver()->GetName());
}
}
}
} // end namespace
......@@ -152,6 +152,11 @@ std::vector<std::string> GetAvailableDriversAsStringVector()
return ret;
}
std::string GetDriverNameFromDataSource(const GDALDatasetType * ds)
{
return std::string(const_cast<GDALDatasetType *>(ds)->GetDriverName());
}
}
}
} // end namespace
......@@ -677,7 +677,7 @@ private:
//Note : the GetDriver() Method has not been encapsulated in otb::ogr::DataSource,
//so we must access the OGR pointer by using .ogr()
std::string driverName(ogrDS->ogr().GetDriver()->GetName());
std::string driverName(otb::ogr::version_proxy::GetDriverNameFromDataSource(&ogrDS->ogr()));
if ( driverName.find("ESRI Shapefile") != std::string::npos)
{
otbAppLogINFO(<<"REPACK the Shapefile ..."<<std::endl);
......
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