[GRASS-SVN] r52769 - grass/trunk/raster/r.mapcalc

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 20 05:49:12 PDT 2012


Author: huhabla
Date: 2012-08-20 05:49:12 -0700 (Mon, 20 Aug 2012)
New Revision: 52769

Modified:
   grass/trunk/raster/r.mapcalc/xcoor3.c
Log:
Fixed wrong z() coordinate computation. Since the depth counts from bottom to top, the z-coordinate should do the same.


Modified: grass/trunk/raster/r.mapcalc/xcoor3.c
===================================================================
--- grass/trunk/raster/r.mapcalc/xcoor3.c	2012-08-20 12:40:39 UTC (rev 52768)
+++ grass/trunk/raster/r.mapcalc/xcoor3.c	2012-08-20 12:49:12 UTC (rev 52769)
@@ -69,7 +69,7 @@
     if (argt[0] != DCELL_TYPE)
 	return E_RES_TYPE;
 
-    z = window->top - (current_depth + 0.5) * window->tb_res;
+    z = window->bottom + ((current_depth) + 0.5) * window->tb_res;
 
     for (i = 0; i < columns; i++)
 	res[i] = z;



More information about the grass-commit mailing list