[GRASS-SVN] r71086 - grass/branches/releasebranch_7_2/raster/r.mode

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 13 10:31:32 PDT 2017


Author: annakrat
Date: 2017-05-13 10:31:32 -0700 (Sat, 13 May 2017)
New Revision: 71086

Modified:
   grass/branches/releasebranch_7_2/raster/r.mode/main.c
Log:
r.mode: copy cover raster color table to output raster (merge from trunk, r70468)

Modified: grass/branches/releasebranch_7_2/raster/r.mode/main.c
===================================================================
--- grass/branches/releasebranch_7_2/raster/r.mode/main.c	2017-05-13 09:16:01 UTC (rev 71085)
+++ grass/branches/releasebranch_7_2/raster/r.mode/main.c	2017-05-13 17:31:32 UTC (rev 71086)
@@ -43,6 +43,7 @@
     const char *args[5];
     struct Popen stats_child, reclass_child;
     struct Categories cover_cats;
+    struct Colors colors;
     FILE *stats, *reclass;
     int first;
     long basecat, covercat, catb, catc;
@@ -138,5 +139,10 @@
     G_popen_close(&reclass_child);
     G_popen_close(&stats_child);
 
+    if (Rast_read_colors(parm.cover->answer, "", &colors) < 0)
+	G_fatal_error(_("Unable to read color table for %s"),
+			parm.cover->answer);
+    Rast_write_colors(parm.output->answer, G_mapset(), &colors);
+
     return 0;
 }



More information about the grass-commit mailing list