Skip to content
Snippets Groups Projects
Commit fcffcc4f authored by Marina Bertolino's avatar Marina Bertolino
Browse files

Merge branch 'bugfix_1446' into develop

parents 7291e408 7b84123a
No related branches found
No related tags found
No related merge requests found
......@@ -725,19 +725,22 @@ PersistentSamplingFilterBase<TInputImage,TMaskImage>
{
tmpLayers.push_back(this->GetInMemoryInput(i));
}
const unsigned int nbFeatThread = std::ceil(inLayer.GetFeatureCount(true) / (float) numberOfThreads);
assert(nbFeatThread > 0);
OGRFeatureDefn &layerDefn = inLayer.GetLayerDefn();
ogr::Layer::const_iterator featIt = inLayer.begin();
unsigned int counter=0;
unsigned int cptFeat = 0;
for(; featIt!=inLayer.end(); ++featIt)
{
ogr::Feature dstFeature(layerDefn);
dstFeature.SetFrom( *featIt, TRUE );
dstFeature.SetFID(featIt->GetFID());
tmpLayers[counter].CreateFeature( dstFeature );
counter++;
if (counter >= tmpLayers.size())
counter = 0;
cptFeat++;
if (cptFeat > nbFeatThread) counter++; cptFeat=0;
}
inLayer.SetSpatialFilter(ITK_NULLPTR);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment