Commit 65256cb8 authored by guillaume pernot's avatar guillaume pernot

Renamed UpdateOutputDataSource to ReopenDataSourceInUpdateMode

parent 26a6ca68
......@@ -105,10 +105,11 @@ private:
typename ListSampleType::Pointer NormalizeListSample(ListSampleType::Pointer input);
/** Update the output DataSource : the input layer is buffered and the input data source is re opened in update mode. */
otb::ogr::DataSource::Pointer UpdateOutputDataSource(otb::ogr::DataSource::Pointer source, otb::ogr::Layer& layer, otb::ogr::DataSource::Pointer buffer);
otb::ogr::DataSource::Pointer ReopenDataSourceInUpdateMode(ogr::DataSource::Pointer source, ogr::Layer& layer,
ogr::DataSource::Pointer buffer);
/** Create the output DataSource. */
otb::ogr::DataSource::Pointer CreateOutputDataSource(otb::ogr::DataSource::Pointer source, otb::ogr::Layer& layer);
otb::ogr::DataSource::Pointer CreateOutputDataSource(ogr::DataSource::Pointer source, ogr::Layer& layer);
/** Add a prediction field in the output layer if it does not exist.
* If computeConfidenceMap evaluates to true a confidence field will be
......
......@@ -147,8 +147,8 @@ typename VectorPrediction<RegressionMode>::ListSampleType::Pointer VectorPredict
template <bool RegressionMode>
otb::ogr::DataSource::Pointer VectorPrediction<RegressionMode>::UpdateOutputDataSource(otb::ogr::DataSource::Pointer source, otb::ogr::Layer& layer,
ogr::DataSource::Pointer buffer)
otb::ogr::DataSource::Pointer VectorPrediction<RegressionMode>::ReopenDataSourceInUpdateMode(ogr::DataSource::Pointer source, ogr::Layer& layer,
ogr::DataSource::Pointer buffer)
{
ogr::DataSource::Pointer output;
// Update mode
......@@ -164,7 +164,7 @@ otb::ogr::DataSource::Pointer VectorPrediction<RegressionMode>::UpdateOutputData
}
template <bool RegressionMode>
otb::ogr::DataSource::Pointer VectorPrediction<RegressionMode>::CreateOutputDataSource(otb::ogr::DataSource::Pointer source, otb::ogr::Layer& layer)
otb::ogr::DataSource::Pointer VectorPrediction<RegressionMode>::CreateOutputDataSource(ogr::DataSource::Pointer source, ogr::Layer& layer)
{
ogr::DataSource::Pointer output;
// Create new OGRDataSource
......@@ -305,12 +305,14 @@ void VectorPrediction<RegressionMode>::DoExecute()
const bool updateMode = !(IsParameterEnabled("out") && HasValue("out"));
ogr::DataSource::Pointer buffer;
otb::ogr::DataSource::Pointer output;
ogr::DataSource::Pointer output;
if (updateMode)
{
// in update mode, output is added to input data source.
// buffer needs to be allocated here, as its life-cycle is bound to "layer"
buffer = ogr::DataSource::New();
output = UpdateOutputDataSource(source, layer, buffer);
output = ReopenDataSourceInUpdateMode(source, layer, buffer);
}
else
{
......
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