From 40e151417b006864a8c645034469d01f4edd0f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Traizet?= <cedric.traizet@c-s.fr> Date: Thu, 2 May 2019 17:32:08 +0200 Subject: [PATCH] ENH: replace GetfieldAs... by GetValue<..> --- .../AppClassification/include/otbTrainVectorBase.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Applications/AppClassification/include/otbTrainVectorBase.hxx b/Modules/Applications/AppClassification/include/otbTrainVectorBase.hxx index caf144257e..c1e4f88f1c 100644 --- a/Modules/Applications/AppClassification/include/otbTrainVectorBase.hxx +++ b/Modules/Applications/AppClassification/include/otbTrainVectorBase.hxx @@ -243,7 +243,7 @@ inline int TrainVectorBase<float, int> ::GetFeatureField(const ogr::Feature & feature, int fieldIndex) { - return(feature.ogr().GetFieldAsInteger( fieldIndex )); + return(feature[fieldIndex].GetValue<int>()); } template <class TInputValue, class TOutputValue> @@ -251,7 +251,7 @@ inline TOutputValue TrainVectorBase<TInputValue, TOutputValue> ::GetFeatureField(const ogr::Feature & feature, int fieldIndex) { - return(feature.ogr().GetFieldAsDouble( fieldIndex )); + return(feature[fieldIndex].GetValue<double>()); } template <class TInputValue, class TOutputValue> @@ -310,7 +310,7 @@ TrainVectorBase<TInputValue, TOutputValue> MeasurementType mv; mv.SetSize( m_FeaturesInfo.m_NbFeatures ); for( unsigned int idx = 0; idx < m_FeaturesInfo.m_NbFeatures; ++idx ) - mv[idx] = feature.ogr().GetFieldAsDouble( featureFieldIndex[idx] ); + mv[idx] = feature[featureFieldIndex[idx]].GetValue<double>(); input->PushBack( mv ); -- GitLab