[GRASS-SVN] r68863 - grass/branches/releasebranch_6_4/vector/v.surf.idw
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jul 5 11:47:17 PDT 2016
Author: neteler
Date: 2016-07-05 11:47:17 -0700 (Tue, 05 Jul 2016)
New Revision: 68863
Modified:
grass/branches/releasebranch_6_4/vector/v.surf.idw/main.c
Log:
v.surf.idw: backport of fix for severe bug in distance calculations (#2820) (releasebranch_7_0, r67242)
Modified: grass/branches/releasebranch_6_4/vector/v.surf.idw/main.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.surf.idw/main.c 2016-07-05 15:44:32 UTC (rev 68862)
+++ grass/branches/releasebranch_6_4/vector/v.surf.idw/main.c 2016-07-05 18:47:17 UTC (rev 68863)
@@ -389,7 +389,7 @@
sum1 = 0.0;
sum2 = 0.0;
for (n = 0; n < nsearch; n++) {
- if ((dist = list[n].dist)) {
+ if ((dist = sqrt(list[n].dist))) {
sum1 += list[n].z / pow ( dist, p );
sum2 += 1.0 / pow ( dist, p );
}
@@ -458,7 +458,8 @@
void calculate_distances(int row, int column, double north,
double east, int *pointsfound)
{
- int j, n, max = 0;
+ int j, n;
+ static int max;
double dx, dy, dist;
static double maxdist;
More information about the grass-commit
mailing list