[GRASS-SVN] r73000 - grass/trunk/raster/r.what

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 20 05:58:54 PDT 2018


Author: mmetz
Date: 2018-07-20 05:58:54 -0700 (Fri, 20 Jul 2018)
New Revision: 73000

Modified:
   grass/trunk/raster/r.what/main.c
Log:
r.what: fix if coords are just outside current region

Modified: grass/trunk/raster/r.what/main.c
===================================================================
--- grass/trunk/raster/r.what/main.c	2018-07-20 00:40:45 UTC (rev 72999)
+++ grass/trunk/raster/r.what/main.c	2018-07-20 12:58:54 UTC (rev 73000)
@@ -368,11 +368,16 @@
 			 *   the point will appear outside the window.
 			 *   So, for these edges, bring the point inside the window
 			 */
-			if (drow == window.rows)
-			    drow--;
-			if (dcol == window.cols)
-			    dcol--;
+			if (north == window.south)
+			    drow = window.rows - 1;
+			if (east == window.east)
+			    dcol = window.cols - 1;
 
+			if (drow < 0)
+			    drow = -1;
+			if (dcol < 0)
+			    dcol = -1;
+
 			if (!done) {
 			    cache[point_cnt].row = (int)drow;
 			    cache[point_cnt].col = (int)dcol;



More information about the grass-commit mailing list