Skip to content
Snippets Groups Projects

Faster SampleAugmentation tests

Merged Guillaume Pasero requested to merge faster_sample_augmentation into develop
1 file
+ 12
0
Compare changes
  • Side-by-side
  • Inline
@@ -204,6 +204,13 @@ SampleAugmentationFilter
auto featureCount = outputLayer.GetFeatureCount(false);
auto templateFeature = this->SelectTemplateFeature(inputLayer, classField, label);
OGRErr err = outputLayer.ogr().StartTransaction();
if (err != OGRERR_NONE)
{
itkExceptionMacro(<< "Unable to start transaction for OGR layer " << outputLayer.ogr().GetName() << ".");
}
for(const auto& sample : samples)
{
ogr::Feature dstFeature(outputLayer.GetLayerDefn());
@@ -220,6 +227,11 @@ SampleAugmentationFilter
}
outputLayer.CreateFeature( dstFeature );
}
err = outputLayer.ogr().CommitTransaction();
if (err != OGRERR_NONE)
{
itkExceptionMacro(<< "Unable to commit transaction for OGR layer " << outputLayer.ogr().GetName() << ".");
}
}
std::set<size_t>
Loading