Commit 7d8e959c authored by Julien Michel's avatar Julien Michel

BUG: Fixing bug #1448

parent a7737cf5
......@@ -196,7 +196,7 @@ private:
const int nbFeatures = GetSelectedItems("feat").size();
input->SetMeasurementVectorSize(nbFeatures);
otb::ogr::Layer::const_iterator it = layer.cbegin();
otb::ogr::Layer::const_iterator itEnd = layer.cend();
for( ; it!=itEnd ; ++it)
......@@ -205,7 +205,11 @@ private:
mv.SetSize(nbFeatures);
for(int idx=0; idx < nbFeatures; ++idx)
{
mv[idx] = (*it)[GetSelectedItems("feat")[idx]].GetValue<double>();
// Beware that itemIndex differs from ogr layer field index
unsigned int itemIndex = GetSelectedItems("feat")[idx];
std::string fieldName = GetChoiceNames( "feat" )[itemIndex];
mv[idx] = (*it)[fieldName].GetValue<double>();
}
input->PushBack(mv);
}
......
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