don't consider nan vertices for interpolation

git-svn-id: http://svn.osgeo.org/qgis/trunk@10243 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
mhugent 2009-02-27 09:10:16 +00:00
parent 11a160efad
commit bc0826af42

View File

@ -18,6 +18,7 @@
#include "qgsinterpolator.h"
#include "qgsvectordataprovider.h"
#include "qgsgeometry.h"
#include <cmath>
QgsInterpolator::QgsInterpolator( const QList<QgsVectorLayer*>& vlayers ): mDataIsCached( false ), mVectorLayers( vlayers ), zCoordInterpolation( false ), mValueAttribute( -1 )
{
@ -89,7 +90,7 @@ int QgsInterpolator::cacheBaseData()
return 3;
}
attributeValue = att_it.value().toDouble(&attributeConversionOk);
if(!attributeConversionOk) //don't consider vertices with attributes like 'nan' for the interpolation
if(!attributeConversionOk || isnan(attributeValue)) //don't consider vertices with attributes like 'nan' for the interpolation
{
continue;
}