[GRASS-SVN] r36696 - grass/trunk/display/d.grid

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Apr 12 05:14:31 EDT 2009


Author: hcho
Date: 2009-04-12 05:14:30 -0400 (Sun, 12 Apr 2009)
New Revision: 36696

Modified:
   grass/trunk/display/d.grid/main.c
Log:
Reduced accumulation errors causing slight shifts in one direction

Modified: grass/trunk/display/d.grid/main.c
===================================================================
--- grass/trunk/display/d.grid/main.c	2009-04-12 09:02:37 UTC (rev 36695)
+++ grass/trunk/display/d.grid/main.c	2009-04-12 09:14:30 UTC (rev 36696)
@@ -185,8 +185,12 @@
     }
 
     if (align->answer) {
-	east = wind.east;
-	north = wind.north;
+	/* reduce accumulated errors when ew_res is not the same as ns_res. */
+	struct Cell_head w;
+
+	G_get_set_window(&w);
+	east = wind.west + (int)((w.west - wind.west) / wind.ew_res) * wind.ew_res;
+	north = wind.south + (int)((w.south - wind.south) / wind.ns_res) * wind.ns_res;
     } else {
         /* get grid easting start */
         if (!G_scan_easting(opt3->answers[0], &east, G_projection())) {



More information about the grass-commit mailing list