[GRASS-SVN] r43444 - grass-addons/imagery/i.landsat.acca

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Sep 10 03:07:47 EDT 2010


Author: hamish
Date: 2010-09-10 07:07:47 +0000 (Fri, 10 Sep 2010)
New Revision: 43444

Modified:
   grass-addons/imagery/i.landsat.acca/main.c
Log:
write out category labels and map title

Modified: grass-addons/imagery/i.landsat.acca/main.c
===================================================================
--- grass-addons/imagery/i.landsat.acca/main.c	2010-09-10 05:11:34 UTC (rev 43443)
+++ grass-addons/imagery/i.landsat.acca/main.c	2010-09-10 07:07:47 UTC (rev 43444)
@@ -95,6 +95,7 @@
     struct Option *input, *output, *hist;
     struct Flag *shadow, *sat5, *filter, *pass2;
     char *in_name, *out_name;
+    struct Categories cats;
 
     Gfile band[5], out;
 
@@ -194,10 +195,19 @@
 	G_close_cell(band[i].fd);
     }
 
-    //      struct Categories cats;
-    //      G_read_raster_cats(out.name, char *mapset, cats)
-    //      G_write_raster_cats(out.name, &cats);
+    /* write out map title and category labels */
+    G_init_cats((CELL) 0, "", &cats);
+    G_set_raster_cats_title("LANDSAT TM/ETM+ Automatic Cloud Cover Assessment", &cats);
+    G_set_cat(IS_SHADOW, "Shadow", &cats);
+    G_set_cat(IS_COLD_CLOUD, "Cold cloud", &cats);
+    G_set_cat(IS_WARM_CLOUD, "Warm cloud", &cats);
 
+    if (G_write_cats(out.name, &cats) <= 0)
+        G_warning(_("Cannot write category file for raster map <%s>"),
+                  out.name);
+    G_free_cats(&cats);
+
+    /* write out command line opts */
     G_short_history(out.name, "raster", &history);
     G_command_history(&history);
     G_write_history(out.name, &history);



More information about the grass-commit mailing list