[GRASS-dev] [GRASS GIS] #1999: r.mask with NULL map doesn't work
GRASS GIS
trac at osgeo.org
Fri Jun 7 02:25:08 PDT 2013
#1999: r.mask with NULL map doesn't work
--------------------------+-------------------------------------------------
Reporter: ferrouswheel | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: svn-develbranch6
Keywords: r.mask | Platform: Linux
Cpu: Unspecified |
--------------------------+-------------------------------------------------
Comment(by glynn):
Replying to [comment:2 glynn]:
> Clearly, the code in lib/raster/get_row.c which reads a MASK map doesn't
handle reclass maps correctly.
Possible fix:
{{{
--- lib/raster/get_row.c (revision 56625)
+++ lib/raster/get_row.c (working copy)
@@ -919,11 +919,13 @@
return;
}
- if (R__.fileinfo[R__.mask_fd].reclass_flag)
+ if (R__.fileinfo[R__.mask_fd].reclass_flag) {
+ embed_nulls(R__.mask_fd, mask_buf, row, CELL_TYPE, 0, 0);
do_reclass_int(R__.mask_fd, mask_buf, 1);
+ }
for (i = 0; i < R__.rd_window.cols; i++)
- if (mask_buf[i] == 0)
+ if (mask_buf[i] == 0 || Rast_is_c_null_value(&mask_buf[i]))
flags[i] = 1;
G__freea(mask_buf);
}}}
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1999#comment:3>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list