[GRASS-SVN] r46323 - grass/trunk/lib/raster

svn_grass at osgeo.org svn_grass at osgeo.org
Tue May 17 09:08:33 EDT 2011


Author: glynn
Date: 2011-05-17 06:08:32 -0700 (Tue, 17 May 2011)
New Revision: 46323

Modified:
   grass/trunk/lib/raster/get_row.c
Log:
Make Rast_get_null_value_row() honour reclass tables


Modified: grass/trunk/lib/raster/get_row.c
===================================================================
--- grass/trunk/lib/raster/get_row.c	2011-05-16 21:16:58 UTC (rev 46322)
+++ grass/trunk/lib/raster/get_row.c	2011-05-17 13:08:32 UTC (rev 46323)
@@ -1021,9 +1021,9 @@
 }
 
 /*!
-   \brief Read or simmulate null value row
+   \brief Read or simulate null value row
 
-   Read or simmulate null value row and set the cells corresponding 
+   Read or simulate null value row and set the cells corresponding 
    to null value to 1. The masked out cells are set to null when the
    mask exists. (the MASK is taken care of by null values
    (if the null file doesn't exist for this map, then the null row
@@ -1038,5 +1038,18 @@
  */
 void Rast_get_null_value_row(int fd, char *flags, int row)
 {
-    get_null_value_row(fd, flags, row, 1);
+    struct fileinfo *fcb = &R__.fileinfo[fd];
+
+    if (!fcb->reclass_flag)
+	get_null_value_row(fd, flags, row, 1);
+    else {
+	CELL *buf = G__alloca(R__.rd_window.cols * sizeof(CELL));
+	int i;
+
+	Rast_get_c_row(fd, buf, row);
+	for (i = 0; i < R__.rd_window.cols; i++)
+	    flags[i] = Rast_is_c_null_value(&buf[i]) ? 1 : 0;
+
+	G__freea(buf);
+    }
 }



More information about the grass-commit mailing list