[GRASS-SVN] r57336 - grass/trunk/raster/r.grow.distance

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 1 01:33:31 PDT 2013


Author: mmetz
Date: 2013-08-01 01:33:31 -0700 (Thu, 01 Aug 2013)
New Revision: 57336

Modified:
   grass/trunk/raster/r.grow.distance/main.c
Log:
r.grow.distance: write history to output

Modified: grass/trunk/raster/r.grow.distance/main.c
===================================================================
--- grass/trunk/raster/r.grow.distance/main.c	2013-07-31 23:40:04 UTC (rev 57335)
+++ grass/trunk/raster/r.grow.distance/main.c	2013-08-01 08:33:31 UTC (rev 57336)
@@ -140,6 +140,7 @@
     int row, col;
     struct Colors colors;
     struct FPRange range;
+    struct History hist;
     DCELL min, max;
     DCELL *out_row;
     double scale = 1.0;
@@ -366,6 +367,12 @@
 	if (Rast_read_colors(in_name, "", &colors) < 0)
 	    G_fatal_error(_("Unable to read color table for raster map <%s>"), in_name);
 	Rast_write_colors(val_name, G_mapset(), &colors);
+
+	Rast_short_history(val_name, "raster", &hist);
+	Rast_set_history(&hist, HIST_DATSRC_1, in_name);
+	Rast_append_format_history(&hist, "value of nearest feature");
+	Rast_command_history(&hist);
+	Rast_write_history(val_name, &hist);
     }
 
     if (dist_name) {
@@ -374,6 +381,12 @@
 	Rast_get_fp_range_min_max(&range, &min, &max);
 	Rast_make_fp_colors(&colors, "rainbow", min, max);
 	Rast_write_colors(dist_name, G_mapset(), &colors);
+
+	Rast_short_history(dist_name, "raster", &hist);
+	Rast_set_history(&hist, HIST_DATSRC_1, in_name);
+	Rast_append_format_history(&hist, "%s distance to nearest feature", opt.met->answer);
+	Rast_command_history(&hist);
+	Rast_write_history(dist_name, &hist);
     }
 
     return EXIT_SUCCESS;



More information about the grass-commit mailing list