 		
 		ret[i].x = gp.X();
 		ret[i].y = gp.Y();
-		
+
 		i++;
 	}
 

	{
		// next we need to get x and y of the 'idx' in the source grid coordinates
		// to do that we first determine the i and j of the target grid coordinates
		
		const int i = fmod(static_cast<double> (idx), static_cast<double> (targetInfo.size_x));
		const int j = floor(static_cast<double> (idx / targetInfo.size_x));



	double ret = kFloatMissing;

	// All values present, regular bilinear interpolation
	
	if (av != kFloatMissing && bv != kFloatMissing && cv != kFloatMissing && dv != kFloatMissing)
	{
		ret = BiLinear(dist.x, dist.y, av, bv, cv, dv);
	}

	// x or y is at grid edge
	
	else if (fabs(dist.y) < kEpsilon && cv != kFloatMissing && dv != kFloatMissing)
	{
		ret = Linear(dist.x, cv, dv);
	}

	else if (fabs(dist.y - 1) < kEpsilon && av != kFloatMissing && bv != kFloatMissing)
	{
		ret = Linear(dist.x, av, bv);
	}
	
	else if (fabs(dist.x) < kEpsilon && cv != kFloatMissing && av != kFloatMissing)
	{
		ret = Linear(dist.y, cv, dv);
	}

	else if (fabs(dist.x - 1) < kEpsilon && av != kFloatMissing && bv != kFloatMissing)
	{
		ret = Linear(dist.y, dv, bv);
	}
		
	// One point missing; these "triangulation" methods have been copied from NFmiInterpolation.cpp

	else if (av == kFloatMissing && bv != kFloatMissing && cv != kFloatMissing && dv != kFloatMissing)
	{
