[GRASS-SVN] r43460 - grass-addons/imagery/i.landsat.toar

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Sep 14 01:02:58 EDT 2010


Author: hamish
Date: 2010-09-14 05:02:58 +0000 (Tue, 14 Sep 2010)
New Revision: 43460

Modified:
   grass-addons/imagery/i.landsat.toar/main.c
Log:
set title and color setting using libgis not system(r.colors)

Modified: grass-addons/imagery/i.landsat.toar/main.c
===================================================================
--- grass-addons/imagery/i.landsat.toar/main.c	2010-09-14 04:49:45 UTC (rev 43459)
+++ grass-addons/imagery/i.landsat.toar/main.c	2010-09-14 05:02:58 UTC (rev 43460)
@@ -50,6 +50,7 @@
     int sensor_id;
     double qcal, rad, ref, percent, ref_mode, sat_zenith, rayleigh;
 
+    struct Colors colors;
     unsigned long hist[256], h_max;
 
     /* initialize GIS environment */
@@ -530,11 +531,11 @@
 	G_free(outrast);
 	G_close_cell(outfd);
 
-	char command[300];
+	/* set grey255 colortable */
+	G_init_colors(&colors);
+	G_add_color_rule(0, 0, 0, 0, 255, 255, 255, 255, &colors);
+	G_write_colors(band_out, G_mapset(), &colors);
 
-	sprintf(command, "r.colors map=%s color=grey", band_out);
-	system(command);
-
 	G_short_history(band_out, "raster", &history);
 
 	sprintf(history.edhist[0], " %s of Landsat-%d %s (method %s)",
@@ -590,6 +591,8 @@
 
 	G_command_history(&history);
 	G_write_history(band_out, &history);
+
+	G_put_cell_title(band_out, history.edhist[0]);
     }
 
     exit(EXIT_SUCCESS);



More information about the grass-commit mailing list