[GRASS-SVN] r53640 - in grass/trunk/raster/r.colors: . tests

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Nov 1 11:21:17 PDT 2012


Author: huhabla
Date: 2012-11-01 11:21:17 -0700 (Thu, 01 Nov 2012)
New Revision: 53640

Added:
   grass/trunk/raster/r.colors/tests/test.r.colors.multiple.sh
   grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_1.ref
   grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_hist.ref
   grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_invert.ref
   grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_logabsscale.ref
   grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_logscale.ref
   grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_1.ref
   grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_hist.ref
   grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_invert.ref
   grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_logabsscale.ref
   grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_logscale.ref
   grass/trunk/raster/r.colors/tests/test_elev_int_maps_grey_eq.ref
   grass/trunk/raster/r.colors/tests/test_elev_int_maps_grey_log.ref
   grass/trunk/raster/r.colors/tests/test_elev_int_maps_random.ref
Modified:
   grass/trunk/raster/r.colors/edit_colors.c
   grass/trunk/raster/r.colors/local_proto.h
   grass/trunk/raster/r.colors/r.colors.html
   grass/trunk/raster/r.colors/stats.c
   grass/trunk/raster/r.colors/tests/test.r.colors.sh
Log:
Added color table creation support for multiple maps


Modified: grass/trunk/raster/r.colors/edit_colors.c
===================================================================
--- grass/trunk/raster/r.colors/edit_colors.c	2012-11-01 18:08:17 UTC (rev 53639)
+++ grass/trunk/raster/r.colors/edit_colors.c	2012-11-01 18:21:17 UTC (rev 53640)
@@ -29,6 +29,7 @@
     int is_from_stdin;
     int remove;
     int have_colors;
+    int i;
     struct Colors colors, colors_tmp;
     struct Cell_stats statf;
     int have_stats = 0;
@@ -36,16 +37,18 @@
     DCELL min, max;
     const char *name = NULL, *mapset = NULL;
     const char *style = NULL, *cmap = NULL, *cmapset = NULL;
-    const char *rules = NULL;
-    int fp;
+    const char *rules = NULL, *file = NULL;
+    int has_cell_type = 0;
+    int has_fcell_type = 0;
     struct GModule *module;
+    struct maps_info input_maps;
 
     struct {
         struct Flag *r, *w, *l, *g, *a, *n, *e;
     } flag; 
 
     struct {
-        struct Option *map, *colr, *rast, *volume, *rules;
+        struct Option *maps, *colr, *rast, *volume, *rules, *file;
     } opt;
     
     G_gisinit(argv[0]);
@@ -64,9 +67,11 @@
     G_add_keyword(_("color table"));
 
     if (type == RASTER3D_TYPE) {
-        opt.map = G_define_standard_option(G_OPT_R3_MAP);
+        opt.maps = G_define_standard_option(G_OPT_R3_MAPS);
+        opt.maps->required = NO;
     } else {
-        opt.map = G_define_standard_option(G_OPT_R_MAP);
+        opt.maps = G_define_standard_option(G_OPT_R_MAPS);
+        opt.maps->required = NO;
     }
 
     opt.colr = G_define_standard_option(G_OPT_M_COLR);
@@ -79,6 +84,12 @@
         _("Raster map from which to copy color table");
     opt.rast->guisection = _("Define");
 
+    opt.file = G_define_standard_option(G_OPT_F_INPUT);
+    opt.file->key = "file";
+    opt.file->required = NO;
+    opt.file->description =
+        _("Input file with one map name per line");
+
     opt.volume = G_define_standard_option(G_OPT_R3_INPUT);
     opt.volume->key = "volume";
     opt.volume->required = NO;
@@ -139,13 +150,18 @@
 
     overwrite = !flag.w->answer;
     remove = flag.r->answer;
-    name = opt.map->answer;
     style = opt.colr->answer;
     rules = opt.rules->answer;
+    file = opt.file->answer;
 
-    if (!name)
-        G_fatal_error(_("No %s map specified"), maptype);
+    if (opt.maps->answer && opt.file->answer)
+        G_fatal_error(_("Options <%s> and <%s> options are mutually exclusive"),
+		      opt.maps->key, opt.file->key);
 
+    if (!opt.maps->answer && !opt.file->answer)
+        G_fatal_error(_("Options <%s> or <%s> must be specified"),
+		      opt.maps->key, opt.file->key);
+
     if (opt.rast->answer && opt.volume->answer)
         G_fatal_error(_("Options <%s> and <%s> options are mutually exclusive"),
 		      opt.rast->key, opt.volume->key);
@@ -172,77 +188,198 @@
     is_from_stdin = rules && strcmp(rules, "-") == 0;
     if (is_from_stdin)
         rules = NULL;
-    /* Switch between raster and volume */
-    if (type == RASTER3D_TYPE) {
-        mapset = G_find_raster3d(name, "");
-    } else {
-        mapset = G_find_raster2(name, "");
+
+    /* Read the map names from the infile */
+    if (file) {
+		FILE *in;
+
+		in = fopen(file, "r");
+		if (!in)
+			G_fatal_error(_("Unable to open %s file <%s>"), maptype, file);
+
+		int num_maps = 0;
+		int max_maps = 0;
+
+		input_maps.names = (char **)G_calloc(100, sizeof(char *));
+		input_maps.mapsets = (char **)G_calloc(100, sizeof(char *));
+		input_maps.map_types = (int*)G_calloc(100, sizeof(int));
+		input_maps.min = (DCELL*)G_calloc(100, sizeof(DCELL));
+		input_maps.max = (DCELL*)G_calloc(100, sizeof(DCELL));
+
+		for (;;) {
+			char buf[GNAME_MAX]; /* Name */
+
+			if (!G_getl2(buf, sizeof(buf), in))
+				break;
+
+			name = G_chop(buf);
+
+			/* Ignore empty lines */
+			if (!*name)
+			continue;
+
+			/* Reallocate memory */
+			if (num_maps >= max_maps) {
+				max_maps += 100;
+				input_maps.names = (char **)G_realloc(input_maps.names, max_maps * sizeof(char *));
+				input_maps.mapsets = (char **)G_realloc(input_maps.mapsets, max_maps * sizeof(char *));
+				input_maps.map_types = (int*)G_realloc(input_maps.map_types, max_maps * sizeof(int));
+				input_maps.min = (DCELL*)G_realloc(input_maps.min, max_maps * sizeof(DCELL));
+				input_maps.max = (DCELL*)G_realloc(input_maps.max, max_maps * sizeof(DCELL));
+			}
+
+			/* Store the map name */
+			input_maps.names[num_maps] = G_store(name);
+
+		    /* Switch between raster and volume */
+		    if (type == RASTER3D_TYPE) {
+		    	input_maps.mapsets[num_maps] = G_store(G_find_raster3d(input_maps.names[num_maps], ""));
+		    } else {
+		    	input_maps.mapsets[num_maps] = G_store(G_find_raster2(input_maps.names[num_maps], ""));
+		    }
+		    if (input_maps.mapsets[num_maps] == NULL)
+		        G_fatal_error(_("%s map <%s> not found"), Maptype, input_maps.names[num_maps]);
+
+			num_maps++;
+		}
+
+        if (num_maps < 1)
+            G_fatal_error(_("No %s map name found in input file <%s>"), maptype, file);
+
+		input_maps.num = num_maps;
+
+        fclose(in);
     }
-    if (mapset == NULL)
-        G_fatal_error(_("%s map <%s> not found"), Maptype, name);
+    else if(opt.maps->answer) {
+		input_maps.num = 0;
+		while(opt.maps->answers[input_maps.num]) {
+			input_maps.num++;
+		}
+		input_maps.names = (char **)G_calloc(input_maps.num, sizeof(char *));
+		input_maps.mapsets = (char **)G_calloc(input_maps.num, sizeof(char *));
+		input_maps.map_types = (int*)G_calloc(input_maps.num, sizeof(int));
+		input_maps.min = (DCELL*)G_calloc(input_maps.num, sizeof(DCELL));
+		input_maps.max = (DCELL*)G_calloc(input_maps.num, sizeof(DCELL));
 
+		for(i = 0; i < input_maps.num; i++) {
+			input_maps.names[i] = G_store(opt.maps->answers[i]);
+
+		    /* Switch between raster and volume */
+		    if (type == RASTER3D_TYPE) {
+		    	input_maps.mapsets[i] = G_store(G_find_raster3d(input_maps.names[i], ""));
+		    } else {
+		    	input_maps.mapsets[i] = G_store(G_find_raster2(input_maps.names[i], ""));
+		    }
+		    if (input_maps.mapsets[i] == NULL)
+		        G_fatal_error(_("%s map <%s> not found"), Maptype, input_maps.names[i]);
+		}
+    }
+
     int stat = -1;
     if (remove) {
-        if (type == RASTER3D_TYPE) {
-            stat = Rast3d_remove_color(name);
-        } else {
-            stat = Rast_remove_colors(name, mapset);
-        }
-        if (stat < 0)
-            G_fatal_error(_("Unable to remove color table of %s map <%s>"), maptype, name);
-        if (stat == 0)
-            G_warning(_("Color table of %s map <%s> not found"), maptype, name);
+    	for(i = 0; i < input_maps.num; i++) {
+    		name = input_maps.names[i];
+    		mapset = input_maps.mapsets[i];
+
+			if (type == RASTER3D_TYPE) {
+				stat = Rast3d_remove_color(name);
+			} else {
+				stat = Rast_remove_colors(name, mapset);
+			}
+			if (stat < 0)
+				G_fatal_error(_("Unable to remove color table of %s map <%s>"), maptype, name);
+			if (stat == 0)
+				G_warning(_("Color table of %s map <%s> not found"), maptype, name);
+    	}
         return EXIT_SUCCESS;
     }
 
     G_suppress_warnings(TRUE);
-    if (type == RASTER3D_TYPE) {
-        have_colors = Rast3d_read_colors(name, mapset, &colors);
-    } else {
-        have_colors = Rast_read_colors(name, mapset, &colors);
-    }
-    /*
-      if (have_colors >= 0)
-      Rast_free_colors(&colors);
-     */
 
-    if (have_colors > 0 && !overwrite) {
-	G_fatal_error(_("Color table exists. Exiting."));
-    }
+	for(i = 0; i < input_maps.num; i++) {
+		name = input_maps.names[i];
+		mapset = input_maps.mapsets[i];
 
+		if (type == RASTER3D_TYPE) {
+			have_colors = Rast3d_read_colors(name, mapset, &colors);
+		} else {
+			have_colors = Rast_read_colors(name, mapset, &colors);
+		}
+		/*
+		  if (have_colors >= 0)
+		  Rast_free_colors(&colors);
+		 */
+
+		if (have_colors > 0 && !overwrite) {
+			G_fatal_error(_("Color table exists for %s map <%s>. Exiting."), maptype, name);
+		}
+	}
+
     G_suppress_warnings(FALSE);
 
-    if (type == RASTER3D_TYPE) {
-        fp = 1; /* g3d maps are always floating point */
-        Rast3d_read_range(name, mapset, &range);
-    } else {
-        fp = Rast_map_is_fp(name, mapset);
-        Rast_read_fp_range(name, mapset, &range);
-    }
-    Rast_get_fp_range_min_max(&range, &min, &max);
+    has_fcell_type = 0;
+    has_cell_type = 0;
+	for(i = 0; i < input_maps.num; i++) {
+		name = input_maps.names[i];
+		mapset = input_maps.mapsets[i];
 
+		if (type == RASTER3D_TYPE) {
+			input_maps.map_types[i] = 1; /* 3D raster maps are always floating point */
+			has_fcell_type = 1;
+			Rast3d_read_range(name, mapset, &range);
+		} else {
+			input_maps.map_types[i] = Rast_map_is_fp(name, mapset);
+			if(input_maps.map_types[i] == 1)
+				has_fcell_type = 1;
+			else
+				has_cell_type = 1;
+
+			Rast_read_fp_range(name, mapset, &range);
+		}
+
+		if(i > 0) {
+			if(has_fcell_type && has_cell_type) {
+				G_fatal_error("Input maps must have the same cell type. "
+						"Mixing of integer and floating point maps is not supported.");
+			}
+		}
+
+		Rast_get_fp_range_min_max(&range, &input_maps.min[i], &input_maps.max[i]);
+
+		/* Compute min, max of all maps*/
+		if(i == 0) {
+			min = input_maps.min[i];
+			max = input_maps.max[i];
+		} else {
+			if(input_maps.min[i] < min)
+				min = input_maps.min[i];
+			if(input_maps.max[i] > max)
+				max = input_maps.max[i];
+		}
+	}
+
     if (is_from_stdin) {
-        if (!read_color_rules(stdin, &colors, min, max, fp))
+        if (!read_color_rules(stdin, &colors, min, max, has_fcell_type))
             exit(EXIT_FAILURE);
     } else if (style) {
         /* 
          * here the predefined color-table color-styles are created by GRASS library calls. 
          */
         if (strcmp(style, "random") == 0) {
-            if (fp)
+            if (has_fcell_type)
                 G_fatal_error(_("Color table 'random' is not supported for floating point %s map"), maptype);
             Rast_make_random_colors(&colors, (CELL) min, (CELL) max);
         } else if (strcmp(style, "grey.eq") == 0) {
-            if (fp)
+            if (has_fcell_type)
                 G_fatal_error(_("Color table 'grey.eq' is not supported for floating point %s map"), maptype);
             if (!have_stats)
-                have_stats = get_stats(name, mapset, &statf);
+                have_stats = get_stats(&input_maps, &statf);
             Rast_make_histogram_eq_colors(&colors, &statf);
         } else if (strcmp(style, "grey.log") == 0) {
-            if (fp)
+            if (has_fcell_type)
                 G_fatal_error(_("Color table 'grey.log' is not supported for floating point %s map"), maptype);
             if (!have_stats)
-                have_stats = get_stats(name, mapset, &statf);
+                have_stats = get_stats(&input_maps, &statf);
             Rast_make_histogram_log_colors(&colors, &statf, (CELL) min,
                                            (CELL) max);
         } else if (G_find_color_rule(style))
@@ -255,7 +392,7 @@
             char path[GPATH_MAX];
 
             /* don't bother with native dirsep as not needed for backwards compatibility */
-            sprintf(path, "%s/etc/colors/%s", G_gisbase(), rules);
+            G_snprintf(path, GPATH_MAX, "%s/etc/colors/%s", G_gisbase(), rules);
 
             if (!Rast_load_fp_colors(&colors, path, min, max))
                 G_fatal_error(_("Unable to load rules file <%s>"), rules);
@@ -279,20 +416,20 @@
         }
     }
 
-    if (fp)
+    if (has_fcell_type)
         Rast_mark_colors_as_fp(&colors);
 
     if (flag.n->answer)
         Rast_invert_colors(&colors);
 
     if (flag.e->answer) {
-        if (fp) {
+        if (has_fcell_type && !has_cell_type) {
             struct FP_stats fpstats;
-            get_fp_stats(name, mapset, &fpstats, min, max, flag.g->answer, flag.a->answer, type);
+            get_fp_stats(&input_maps, &fpstats, min, max, flag.g->answer, flag.a->answer, type);
             Rast_histogram_eq_fp_colors(&colors_tmp, &colors, &fpstats);
         } else {
             if (!have_stats)
-                have_stats = get_stats(name, mapset, &statf);
+                have_stats = get_stats(&input_maps, &statf);
             Rast_histogram_eq_colors(&colors_tmp, &colors, &statf);
         }
         colors = colors_tmp;
@@ -308,16 +445,21 @@
         colors = colors_tmp;
     }
 
-    if (fp)
-        Rast_mark_colors_as_fp(&colors);
-    if (type == RASTER3D_TYPE) {
-        Rast3d_write_colors(name, mapset, &colors);
-    } else {
-        Rast_write_colors(name, mapset, &colors);
-    }
-    G_message(_("Color table for %s map <%s> set to '%s'"), maptype, name,
-              is_from_stdin ? "rules" : style ? style : rules ? rules :
-              cmap);
+	for(i = 0; i < input_maps.num; i++) {
+		name = input_maps.names[i];
+		mapset = input_maps.mapsets[i];
 
+		if (input_maps.map_types[i])
+			Rast_mark_colors_as_fp(&colors);
+		if (type == RASTER3D_TYPE) {
+			Rast3d_write_colors(name, mapset, &colors);
+		} else {
+			Rast_write_colors(name, mapset, &colors);
+		}
+		G_message(_("Color table for %s map <%s> set to '%s'"), maptype, name,
+				  is_from_stdin ? "rules" : style ? style : rules ? rules :
+				  cmap);
+	}
+
     exit(EXIT_SUCCESS);
 }

Modified: grass/trunk/raster/r.colors/local_proto.h
===================================================================
--- grass/trunk/raster/r.colors/local_proto.h	2012-11-01 18:08:17 UTC (rev 53639)
+++ grass/trunk/raster/r.colors/local_proto.h	2012-11-01 18:21:17 UTC (rev 53640)
@@ -25,13 +25,22 @@
 #include <grass/glocale.h>
 #include <grass/raster3d.h>
 
+struct maps_info {
+	int num;
+	char **names;
+	char **mapsets;
+	int *map_types;
+	DCELL *min;
+	DCELL *max;
+
+};
+
 #define RASTER_TYPE   1
 #define RASTER3D_TYPE 2
 
 /* stats.c */
-int get_stats(const char *, const char *, struct Cell_stats *);
-void get_fp_stats(const char *name, const char *mapset,
-		  struct FP_stats *statf,
+int get_stats(struct maps_info *, struct Cell_stats *);
+void get_fp_stats(struct maps_info *, struct FP_stats *statf,
 		  DCELL min, DCELL max, int geometric, int geom_abs, int);
 
 /* edit_colors.c */

Modified: grass/trunk/raster/r.colors/r.colors.html
===================================================================
--- grass/trunk/raster/r.colors/r.colors.html	2012-11-01 18:08:17 UTC (rev 53639)
+++ grass/trunk/raster/r.colors/r.colors.html	2012-11-01 18:21:17 UTC (rev 53640)
@@ -1,9 +1,12 @@
 <h2>DESCRIPTION</h2>
 
 <em>r.colors</em> allows the user to create and/or modify the color
-table for a raster map. The raster map (specified on the command line
-by <b>map</b>) must exist in the user's current mapset search path.
+table for a raster map or several raster maps at once. 
+The raster maps (specified on the command line
+by <b>map</b> or as <b>file</b> using an input file with one map name per line) 
+must exist in the user's current mapset search path.
 
+
 <p>The <b>rast</b> option allows user to specify a raster map <i>name</i>
 from which to copy the color map.
 
@@ -20,7 +23,7 @@
 a color table identical to <em>color=grey.eq</em>,
 because <em>grey.eq</em> scales the fraction by 256 to get a grey
 level, while <b>-e</b> uses it to interpolate the original color
-table. If the original colour table is a 0-255 grey scale, <b>-e</b>
+table. If the original color table is a 0-255 grey scale, <b>-e</b>
 is effectively scaling the fraction by 255. Different algorithms are
 used. <b>-e</b> is designed to work with any color table, both the
 floating point and the integer raster maps.
@@ -53,6 +56,12 @@
 pre-defined color tables that <em>r.colors</em> knows how to create
 without any further input.
 
+<p>
+In case several input raster maps are provided the range (min, max) of all maps 
+will be used for color table creation. Hence the created color table will span from
+the smallest minimum to the largest maximum value of all input raster maps and
+will be applied to all input raster maps.
+
 <p>In general, tables which associate colors with percentages (aspect, bcyr, byg,
 byr, elevation, grey, gyr, rainbow, ramp, ryb, ryg and wave) can be applied to
 any data, while those which use absolute values (aspectcolr, curvature, etopo2,

Modified: grass/trunk/raster/r.colors/stats.c
===================================================================
--- grass/trunk/raster/r.colors/stats.c	2012-11-01 18:08:17 UTC (rev 53639)
+++ grass/trunk/raster/r.colors/stats.c	2012-11-01 18:21:17 UTC (rev 53640)
@@ -21,137 +21,151 @@
 #include <stdlib.h>
 #include "local_proto.h"
 
-int get_stats(const char *name, const char *mapset, struct Cell_stats *statf) {
+int get_stats(struct maps_info *input_maps, struct Cell_stats *statf) {
     CELL *cell;
     int row, nrows, ncols;
     int fd;
+    int i;
 
-    fd = Rast_open_old(name, mapset);
+    Rast_init_cell_stats(statf);
 
-    cell = Rast_allocate_c_buf();
-    nrows = Rast_window_rows();
-    ncols = Rast_window_cols();
+    for(i = 0; i < input_maps->num; i++) {
+		fd = Rast_open_old(input_maps->names[i], input_maps->mapsets[i]);
 
-    Rast_init_cell_stats(statf);
-    G_verbose_message(_("Reading raster map <%s>..."),
-            G_fully_qualified_name(name, mapset));
-    for (row = 0; row < nrows; row++) {
-        G_percent(row, nrows, 2);
-        Rast_get_c_row(fd, cell, row);
-        Rast_update_cell_stats(cell, ncols, statf);
+	    cell = Rast_allocate_c_buf();
+	    nrows = Rast_window_rows();
+	    ncols = Rast_window_cols();
+
+		G_verbose_message(_("(%i/%i) Reading raster map <%s>..."),
+				i + 1, input_maps->num,
+				G_fully_qualified_name(input_maps->names[i], input_maps->mapsets[i]));
+
+		for (row = 0; row < nrows; row++) {
+			G_percent(row, nrows, 2);
+			Rast_get_c_row(fd, cell, row);
+			Rast_update_cell_stats(cell, ncols, statf);
+		}
+		G_percent(row, nrows, 2);
+		Rast_close(fd);
+	    G_free(cell);
     }
-    G_percent(row, nrows, 2);
-    Rast_close(fd);
-    G_free(cell);
 
     return 1;
 }
 
-void get_fp_stats(const char *name, const char *mapset,
+void get_fp_stats(struct maps_info *input_maps,
         struct FP_stats *statf,
         DCELL min, DCELL max, int geometric, int geom_abs, int type) {
     DCELL *dcell = NULL;
     int row, col, depth, nrows, ncols, ndepths = 1;
     int fd;
+    int i;
+    char *name;
+    char *mapset;
     RASTER3D_Map *map3d = NULL;
 
-    if (type == RASTER_TYPE) {
-        fd = Rast_open_old(name, mapset);
-        dcell = Rast_allocate_d_buf();
-        nrows = Rast_window_rows();
-        ncols = Rast_window_cols();
-    } else {
-        /* Initiate the default settings */
-        Rast3d_init_defaults();
+	statf->geometric = geometric;
+	statf->geom_abs = geom_abs;
+	statf->flip = 0;
 
-        map3d = Rast3d_open_cell_old(name, mapset, RASTER3D_DEFAULT_WINDOW,
-                RASTER3D_TILE_SAME_AS_FILE, RASTER3D_USE_CACHE_DEFAULT);
+	if (statf->geometric) {
+		if (min * max < 0)
+			G_fatal_error(_("Unable to use logarithmic scaling if range includes zero"));
 
-        if (map3d == NULL)
-            Rast3d_fatal_error(_("Error opening 3d raster map"));
+		if (min < 0) {
+			statf->flip = 1;
+			min = -min;
+			max = -max;
+		}
+		min = log(min);
+		max = log(max);
+	}
 
-        nrows = map3d->window.rows;
-        ncols = map3d->window.cols;
-        ndepths = map3d->window.depths;
-    }
+	if (statf->geom_abs) {
+		double a = log(fabs(min) + 1);
+		double b = log(fabs(max) + 1);
+		int has_zero = min * max < 0;
+		min = a < b ? a : b;
+		max = a > b ? a : b;
+		if (has_zero)
+			min = 0;
+	}
 
-    statf->geometric = geometric;
-    statf->geom_abs = geom_abs;
-    statf->flip = 0;
+	statf->count = 1000;
+	statf->min = min;
+	statf->max = max;
+	statf->stats = G_calloc(statf->count + 1, sizeof (unsigned long));
+	statf->total = 0;
 
-    if (statf->geometric) {
-        if (min * max < 0)
-            G_fatal_error(_("Unable to use logarithmic scaling if range includes zero"));
+	/* Loop over all input maps */
+	for(i = 0; i < input_maps->num; i++) {
+		name = input_maps->names[i];
+		mapset = input_maps->mapsets[i];
 
-        if (min < 0) {
-            statf->flip = 1;
-            min = -min;
-            max = -max;
-        }
+		if (type == RASTER_TYPE) {
+			fd = Rast_open_old(name, mapset);
+			dcell = Rast_allocate_d_buf();
+			nrows = Rast_window_rows();
+			ncols = Rast_window_cols();
+		} else {
+			/* Initiate the default settings */
+			Rast3d_init_defaults();
 
-        min = log(min);
-        max = log(max);
-    }
+			map3d = Rast3d_open_cell_old(name, mapset, RASTER3D_DEFAULT_WINDOW,
+					RASTER3D_TILE_SAME_AS_FILE, RASTER3D_USE_CACHE_DEFAULT);
 
-    if (statf->geom_abs) {
-        double a = log(fabs(min) + 1);
-        double b = log(fabs(max) + 1);
-        int has_zero = min * max < 0;
-        min = a < b ? a : b;
-        max = a > b ? a : b;
-        if (has_zero)
-            min = 0;
-    }
+			if (map3d == NULL)
+				Rast3d_fatal_error(_("Error opening 3d raster map"));
 
-    statf->count = 1000;
-    statf->min = min;
-    statf->max = max;
-    statf->stats = G_calloc(statf->count + 1, sizeof (unsigned long));
-    statf->total = 0;
+			nrows = map3d->window.rows;
+			ncols = map3d->window.cols;
+			ndepths = map3d->window.depths;
+		}
 
-    G_verbose_message(_("Reading map <%s>..."),
-            G_fully_qualified_name(name, mapset));
+		G_verbose_message(_("(%i/%i) Reading map <%s>..."), i, input_maps->num,
+				G_fully_qualified_name(name, mapset));
 
-    for (depth = 0; depth < ndepths; depth++) {
-        for (row = 0; row < nrows; row++) {
-            G_percent(row, nrows, 2);
+		for (depth = 0; depth < ndepths; depth++) {
+			for (row = 0; row < nrows; row++) {
+				G_percent(row, nrows, 2);
 
-            if (type == RASTER_TYPE)
-                Rast_get_d_row(fd, dcell, row);
+				if (type == RASTER_TYPE)
+					Rast_get_d_row(fd, dcell, row);
 
-            for (col = 0; col < ncols; col++) {
-                DCELL x;
-                int i;
+				for (col = 0; col < ncols; col++) {
+					DCELL x;
+					int j;
 
-                if (type == RASTER_TYPE)
-                    x = dcell[col];
-                else
-                    x = Rast3d_get_double(map3d, col, row, depth);
+					if (type == RASTER_TYPE)
+						x = dcell[col];
+					else
+						x = Rast3d_get_double(map3d, col, row, depth);
 
-                if (Rast_is_d_null_value(&x))
-                    continue;
+					if (Rast_is_d_null_value(&x))
+						continue;
 
-                if (statf->flip)
-                    x = -x;
-                if (statf->geometric)
-                    x = log(x);
-                if (statf->geom_abs)
-                    x = log(fabs(x) + 1);
+					if (statf->flip)
+						x = -x;
+					if (statf->geometric)
+						x = log(x);
+					if (statf->geom_abs)
+						x = log(fabs(x) + 1);
 
-                i = (int) floor(statf->count * (x - statf->min) / (statf->max - statf->min));
-                statf->stats[i]++;
-                statf->total++;
-            }
-        }
-    }
+					j = (int) floor(statf->count * (x - statf->min) / (statf->max - statf->min));
+					statf->stats[j]++;
+					statf->total++;
+				}
+			}
+		}
 
-    G_percent(row, nrows, 2);
+		G_percent(row, nrows, 2);
 
-    if (type == RASTER_TYPE) {
-        Rast_close(fd);
-	if(dcell)
-    	    G_free(dcell);
-    } else {
-        Rast3d_close(map3d);
-    }
+		if (type == RASTER_TYPE) {
+			Rast_close(fd);
+		if(dcell)
+				G_free(dcell);
+		} else {
+			Rast3d_close(map3d);
+		}
+	}
 }

Added: grass/trunk/raster/r.colors/tests/test.r.colors.multiple.sh
===================================================================
--- grass/trunk/raster/r.colors/tests/test.r.colors.multiple.sh	                        (rev 0)
+++ grass/trunk/raster/r.colors/tests/test.r.colors.multiple.sh	2012-11-01 18:21:17 UTC (rev 53640)
@@ -0,0 +1,73 @@
+# This script tests r.colors and r.colors.out
+# Color rules are set with r.colors and exported using r.colors.out
+
+# We specific a small region in the
+# @preprocess step and generate
+# raster data with r.mapcalc
+# The region setting should work for UTM and LL test locations
+g.region s=0 n=90 w=0 e=100 b=0 t=50 res=10 res3=10 -p3
+# To test r.colors, we need several maps of different types
+r.mapcalc --o expr="test_elev_double_1 = double(rand(-15.0, 5.0))"
+r.mapcalc --o expr="test_elev_double_2 = double(rand(0.0, 10.0))"
+r.mapcalc --o expr="test_elev_double_3 = double(rand(5.0, 15.0))"
+
+r.mapcalc --o expr="test_elev_int_1 = int(rand(-15.0, 5.0))"
+r.mapcalc --o expr="test_elev_int_2 = int(rand(0.0, 10.0))"
+r.mapcalc --o expr="test_elev_int_3 = int(rand(5.0, 15.0))"
+
+
+# First we @test the integer maps
+# We use the examples to test the import, export and setting of color tables with different options
+# the validation is based on raster map color rules @files.txterence files created with r.colors.out
+r.colors    map=test_elev_int_1,test_elev_int_2,test_elev_int_3 \
+            color=difference && r.colors.out --o map=test_elev_int_3 \
+            rules=test_elev_int_maps_difference_1.txt
+
+r.colors -e map=test_elev_int_1,test_elev_int_2,test_elev_int_3 \
+            color=difference && r.colors.out --o map=test_elev_int_3 \
+            rules=test_elev_int_maps_difference_hist.txt
+
+r.colors -n map=test_elev_int_1,test_elev_int_2,test_elev_int_3 \
+            color=difference && r.colors.out --o map=test_elev_int_3 \
+            rules=test_elev_int_maps_difference_invert.txt
+
+r.colors -a map=test_elev_int_1,test_elev_int_2,test_elev_int_3 \
+            color=difference && r.colors.out --o map=test_elev_int_3 \
+            rules=test_elev_int_maps_difference_logabsscale.txt
+
+r.colors -g map=test_elev_int_2,test_elev_int_3 \
+            color=difference && r.colors.out --o map=test_elev_int_3 \
+            rules=test_elev_int_maps_difference_logscale.txt
+
+r.colors    map=test_elev_int_1,test_elev_int_2,test_elev_int_3 \
+            color=random && r.colors.out --o map=test_elev_int_3 \
+            rules=test_elev_int_maps_random.txt
+
+r.colors    map=test_elev_int_1,test_elev_int_2,test_elev_int_3 \
+            color=grey.eq && r.colors.out --o map=test_elev_int_3 \
+            rules=test_elev_int_maps_grey_eq.txt
+
+r.colors    map=test_elev_int_2,test_elev_int_3 \
+            color=grey.log && r.colors.out --o map=test_elev_int_3 \
+            rules=test_elev_int_maps_grey_log.txt
+
+# Tests with floating point maps
+r.colors    map=test_elev_double_1,test_elev_double_2,test_elev_double_3 \
+            color=difference && r.colors.out --o map=test_elev_double_3 \
+            rules=test_elev_double_maps_difference_1.txt
+
+r.colors -e map=test_elev_double_1,test_elev_double_2,test_elev_double_3 \
+            color=difference && r.colors.out --o map=test_elev_double_3 \
+            rules=test_elev_double_maps_difference_hist.txt
+
+r.colors -n map=test_elev_double_1,test_elev_double_2,test_elev_double_3 \
+            color=difference && r.colors.out --o map=test_elev_double_3 \
+            rules=test_elev_double_maps_difference_invert.txt
+
+r.colors -a map=test_elev_double_1,test_elev_double_2,test_elev_double_3 \
+            color=difference && r.colors.out --o map=test_elev_double_3 \
+            rules=test_elev_double_maps_difference_logabsscale.txt
+
+r.colors -g map=test_elev_double_2,test_elev_double_3 \
+            color=difference && r.colors.out --o map=test_elev_double_3 \
+            rules=test_elev_double_maps_difference_logscale.txt

Modified: grass/trunk/raster/r.colors/tests/test.r.colors.sh
===================================================================
--- grass/trunk/raster/r.colors/tests/test.r.colors.sh	2012-11-01 18:08:17 UTC (rev 53639)
+++ grass/trunk/raster/r.colors/tests/test.r.colors.sh	2012-11-01 18:21:17 UTC (rev 53640)
@@ -16,8 +16,8 @@
 r3.mapcalc --o expr="volume_double_null = if(row() == 1 || row() == 5, null(), volume_double)"
 
 # First we @test the integer maps
-# We use the examples to test the import, export and setting of color tables with differrent options
-# the vaidation is based on raster map colur rules @files reference files created with r.colors.out
+# We use the examples to test the import, export and setting of color tables with different options
+# the validation is based on raster map color rules @files reference files created with r.colors.out
 r.colors    map=test_elev_int rules=example1 && r.colors.out --o map=test_elev_int rules=test_elev_int_example1.txt
 r.colors -e map=test_elev_int rules=example1 && r.colors.out --o map=test_elev_int rules=test_elev_int_example1_hist.txt
 r.colors    map=test_elev_int rules=example2 && r.colors.out --o map=test_elev_int rules=test_elev_int_example2.txt

Added: grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_1.ref
===================================================================
--- grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_1.ref	                        (rev 0)
+++ grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_1.ref	2012-11-01 18:21:17 UTC (rev 53640)
@@ -0,0 +1,5 @@
+-15 0:0:255
+0 255:255:255
+14.8489 255:0:0
+nv 255:255:255
+default 255:255:255

Added: grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_hist.ref
===================================================================
--- grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_hist.ref	                        (rev 0)
+++ grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_hist.ref	2012-11-01 18:21:17 UTC (rev 53640)
@@ -0,0 +1,223 @@
+-15 0:0:255
+-14.9702 3:3:255
+-14.9105 5:5:255
+-14.8508 7:7:255
+-14.612 9:9:255
+-14.5821 11:11:255
+-14.1642 13:13:255
+-13.9553 15:15:255
+-13.9254 16:16:255
+-13.5076 18:18:255
+-13.4479 20:20:255
+-13.3285 22:22:255
+-13.1494 26:26:255
+-12.9703 28:28:255
+-12.7613 30:30:255
+-12.6121 31:31:255
+-12.4628 33:33:255
+-12.433 35:35:255
+-12.1942 37:37:255
+-11.5674 39:39:255
+-11.448 43:43:255
+-11.2689 45:45:255
+-11.2092 46:46:255
+-10.3137 48:48:255
+-9.92569 52:52:255
+-9.5675 54:54:255
+-9.03022 56:56:255
+-8.67203 58:58:255
+-8.31384 62:62:255
+-7.68702 63:63:255
+-7.62732 65:65:255
+-7.56762 67:67:255
+-7.41838 69:69:255
+-7.11989 71:71:255
+-6.43336 73:73:255
+-5.89608 75:75:255
+-5.68714 77:77:255
+-5.23941 78:78:255
+-5.06031 80:80:255
+-4.79167 82:82:255
+-4.73197 84:84:255
+-4.67228 86:86:255
+-4.49318 88:88:255
+-4.46333 90:90:255
+-4.34394 92:92:255
+-4.135 93:93:255
+-3.86636 95:95:255
+-3.62757 97:97:255
+-3.59772 99:99:255
+-3.56787 101:101:255
+-3.41862 103:103:255
+-3.26938 105:105:255
+-2.64255 107:107:255
+-2.49331 109:109:255
+-1.62769 110:110:255
+-1.44859 112:112:255
+-1.41875 114:114:255
+-1.35905 116:116:255
+-1.2695 118:118:255
+-0.941163 120:120:255
+-0.224789 122:122:255
+0.0140018 125:125:255
+0.0438507 127:127:255
+0.0736996 131:131:255
+0.193095 133:133:255
+0.222944 135:135:255
+0.34234 137:137:255
+0.402038 139:139:255
+0.431887 142:142:255
+0.521433 144:144:255
+0.551282 146:146:255
+0.700527 148:148:255
+0.760225 150:150:255
+0.790073 152:152:255
+0.849771 154:154:255
+0.939318 157:157:255
+1.02886 159:159:255
+1.14826 161:161:255
+1.20796 165:165:255
+1.23781 169:169:255
+1.26766 171:171:255
+1.2975 172:172:255
+1.32735 174:174:255
+1.4169 176:176:255
+1.62584 180:180:255
+1.71539 182:182:255
+1.77509 186:186:255
+1.89448 189:189:255
+2.07358 191:191:255
+2.25267 193:193:255
+2.34222 195:195:255
+2.46161 197:197:255
+2.52131 199:199:255
+2.55116 204:204:255
+2.73025 208:208:255
+2.8795 210:210:255
+2.99889 212:212:255
+3.08844 214:214:255
+3.17799 216:216:255
+3.35708 219:219:255
+3.41678 221:221:255
+3.65557 225:225:255
+3.68542 227:227:255
+3.71527 229:229:255
+3.80481 231:231:255
+3.95406 233:233:255
+4.1033 234:234:255
+4.2824 236:236:255
+4.31224 238:238:255
+4.34209 240:240:255
+4.55104 242:242:255
+4.67043 244:244:255
+4.70028 246:246:255
+4.87937 248:248:255
+4.96892 249:249:255
+5.02862 253:253:255
+5.05847 255:255:255
+5.08832 255:253:253
+5.11817 255:251:251
+5.14801 255:249:249
+5.17786 255:247:247
+5.20771 255:244:244
+5.26741 255:242:242
+5.29726 255:240:240
+5.32711 255:238:238
+5.41665 255:236:236
+5.4465 255:234:234
+5.53605 255:230:230
+5.5659 255:228:228
+5.68529 255:226:226
+5.71514 255:223:223
+5.74499 255:221:221
+5.77484 255:219:219
+5.80469 255:217:217
+5.83454 255:215:215
+5.89424 255:213:213
+5.92409 255:209:209
+6.01363 255:207:207
+6.13303 255:206:206
+6.19273 255:202:202
+6.25242 255:200:200
+6.28227 255:196:196
+6.40167 255:194:194
+6.70016 255:192:192
+6.73001 255:190:190
+6.7897 255:183:183
+6.81955 255:181:181
+6.87925 255:177:177
+6.9091 255:175:175
+7.0285 255:173:173
+7.35683 255:171:171
+7.41653 255:169:169
+7.53593 255:164:164
+7.68517 255:162:162
+7.71502 255:156:156
+7.86427 255:154:154
+7.98366 255:152:152
+8.10306 255:150:150
+8.13291 255:147:147
+8.16275 255:143:143
+8.312 255:141:141
+8.34185 255:137:137
+8.3717 255:135:135
+8.55079 255:133:133
+8.64034 255:131:131
+8.67019 255:130:130
+8.70003 255:128:128
+8.72988 255:124:124
+8.78958 255:118:118
+8.87913 255:116:116
+8.93883 255:114:114
+8.96867 255:113:113
+9.05822 255:111:111
+9.20747 255:109:109
+9.29701 255:107:107
+9.32686 255:105:105
+9.56565 255:101:101
+9.6552 255:97:97
+9.68505 255:95:95
+9.86414 255:94:94
+9.89399 255:92:92
+9.98354 255:90:90
+10.1029 255:88:88
+10.1328 255:86:86
+10.1626 255:84:84
+10.282 255:80:80
+10.3417 255:78:78
+10.4313 255:76:76
+10.5805 255:75:75
+10.6999 255:71:71
+10.7298 255:69:69
+10.7895 255:67:67
+10.879 255:65:65
+11.1775 255:63:63
+11.267 255:61:61
+11.6849 255:59:59
+11.7745 255:57:57
+11.8043 255:56:56
+11.8342 255:54:54
+11.864 255:52:52
+12.0431 255:50:50
+12.4013 255:48:48
+12.5505 255:46:46
+12.6998 255:42:42
+12.7296 255:40:40
+12.849 255:38:38
+13.1177 255:33:33
+13.1774 255:31:31
+13.3266 255:27:27
+13.5356 255:25:25
+13.6251 255:23:23
+13.7445 255:21:21
+13.7743 255:18:18
+13.8639 255:16:16
+13.9534 255:14:14
+14.043 255:12:12
+14.2221 255:10:10
+14.3415 255:8:8
+14.5504 255:6:6
+14.6698 255:2:2
+14.8489 255:2:2
+nv 255:255:255
+default 255:255:255

Added: grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_invert.ref
===================================================================
--- grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_invert.ref	                        (rev 0)
+++ grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_invert.ref	2012-11-01 18:21:17 UTC (rev 53640)
@@ -0,0 +1,5 @@
+-15 0:0:255
+0 255:255:255
+14.8489 255:0:0
+nv 255:255:255
+default 255:255:255

Added: grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_logabsscale.ref
===================================================================
--- grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_logabsscale.ref	                        (rev 0)
+++ grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_logabsscale.ref	2012-11-01 18:21:17 UTC (rev 53640)
@@ -0,0 +1,398 @@
+1 0:0:255
+1.02811 5:5:255
+-1.02811 5:5:255
+-1 0:0:255
+1.02811 5:5:255
+1.05702 10:10:255
+-1.05702 10:10:255
+-1.02811 5:5:255
+1.05702 10:10:255
+1.08673 15:15:255
+-1.08673 15:15:255
+-1.05702 10:10:255
+1.08673 15:15:255
+1.11729 20:20:255
+-1.11729 20:20:255
+-1.08673 15:15:255
+1.11729 20:20:255
+1.1487 25:25:255
+-1.1487 25:25:255
+-1.11729 20:20:255
+1.1487 25:25:255
+1.18099 30:30:255
+-1.18099 30:30:255
+-1.1487 25:25:255
+1.18099 30:30:255
+1.21419 35:35:255
+-1.21419 35:35:255
+-1.18099 30:30:255
+1.21419 35:35:255
+1.24833 40:40:255
+-1.24833 40:40:255
+-1.21419 35:35:255
+1.24833 40:40:255
+1.28343 45:45:255
+-1.28343 45:45:255
+-1.24833 40:40:255
+1.28343 45:45:255
+1.31951 50:50:255
+-1.31951 50:50:255
+-1.28343 45:45:255
+1.31951 50:50:255
+1.3566 55:55:255
+-1.3566 55:55:255
+-1.31951 50:50:255
+1.3566 55:55:255
+1.39474 60:60:255
+-1.39474 60:60:255
+-1.3566 55:55:255
+1.39474 60:60:255
+1.43396 65:65:255
+-1.43396 65:65:255
+-1.39474 60:60:255
+1.43396 65:65:255
+1.47427 71:71:255
+-1.47427 71:71:255
+-1.43396 65:65:255
+1.47427 71:71:255
+1.51572 76:76:255
+-1.51572 76:76:255
+-1.47427 71:71:255
+1.51572 76:76:255
+1.55833 81:81:255
+-1.55833 81:81:255
+-1.51572 76:76:255
+1.55833 81:81:255
+1.60214 86:86:255
+-1.60214 86:86:255
+-1.55833 81:81:255
+1.60214 86:86:255
+1.64718 91:91:255
+-1.64718 91:91:255
+-1.60214 86:86:255
+1.64718 91:91:255
+1.69349 96:96:255
+-1.69349 96:96:255
+-1.64718 91:91:255
+1.69349 96:96:255
+1.7411 101:101:255
+-1.7411 101:101:255
+-1.69349 96:96:255
+1.7411 101:101:255
+1.79005 106:106:255
+-1.79005 106:106:255
+-1.7411 101:101:255
+1.79005 106:106:255
+1.84038 111:111:255
+-1.84038 111:111:255
+-1.79005 106:106:255
+1.84038 111:111:255
+1.89212 116:116:255
+-1.89212 116:116:255
+-1.84038 111:111:255
+1.89212 116:116:255
+1.94531 121:121:255
+-1.94531 121:121:255
+-1.89212 116:116:255
+1.94531 121:121:255
+2 126:126:255
+-2 126:126:255
+-1.94531 121:121:255
+2 126:126:255
+2.05623 131:131:255
+-2.05623 131:131:255
+-2 126:126:255
+2.05623 131:131:255
+2.11404 137:137:255
+-2.11404 137:137:255
+-2.05623 131:131:255
+2.11404 137:137:255
+2.17347 142:142:255
+-2.17347 142:142:255
+-2.11404 137:137:255
+2.17347 142:142:255
+2.23457 147:147:255
+-2.23457 147:147:255
+-2.17347 142:142:255
+2.23457 147:147:255
+2.2974 152:152:255
+-2.2974 152:152:255
+-2.23457 147:147:255
+2.2974 152:152:255
+2.36199 157:157:255
+-2.36199 157:157:255
+-2.2974 152:152:255
+2.36199 157:157:255
+2.42839 162:162:255
+-2.42839 162:162:255
+-2.36199 157:157:255
+2.42839 162:162:255
+2.49666 167:167:255
+-2.49666 167:167:255
+-2.42839 162:162:255
+2.49666 167:167:255
+2.56685 172:172:255
+-2.56685 172:172:255
+-2.49666 167:167:255
+2.56685 172:172:255
+2.63902 177:177:255
+-2.63902 177:177:255
+-2.56685 172:172:255
+2.63902 177:177:255
+2.71321 182:182:255
+-2.71321 182:182:255
+-2.63902 177:177:255
+2.71321 182:182:255
+2.78949 187:187:255
+-2.78949 187:187:255
+-2.71321 182:182:255
+2.78949 187:187:255
+2.86791 192:192:255
+-2.86791 192:192:255
+-2.78949 187:187:255
+2.86791 192:192:255
+2.94854 197:197:255
+-2.94854 197:197:255
+-2.86791 192:192:255
+2.94854 197:197:255
+3.03143 202:202:255
+-3.03143 202:202:255
+-2.94854 197:197:255
+3.03143 202:202:255
+3.11666 208:208:255
+-3.11666 208:208:255
+-3.03143 202:202:255
+3.11666 208:208:255
+3.20428 213:213:255
+-3.20428 213:213:255
+-3.11666 208:208:255
+3.20428 213:213:255
+3.29436 218:218:255
+-3.29436 218:218:255
+-3.20428 213:213:255
+3.29436 218:218:255
+3.38698 223:223:255
+-3.38698 223:223:255
+-3.29436 218:218:255
+3.38698 223:223:255
+3.4822 228:228:255
+-3.4822 228:228:255
+-3.38698 223:223:255
+3.4822 228:228:255
+3.5801 233:233:255
+-3.5801 233:233:255
+-3.4822 228:228:255
+3.5801 233:233:255
+3.68075 238:238:255
+-3.68075 238:238:255
+-3.5801 233:233:255
+3.68075 238:238:255
+3.78423 243:243:255
+-3.78423 243:243:255
+-3.68075 238:238:255
+3.78423 243:243:255
+3.89062 248:248:255
+-3.89062 248:248:255
+-3.78423 243:243:255
+3.89062 248:248:255
+4 253:253:255
+-4 253:253:255
+-3.89062 248:248:255
+4 253:253:255
+4.11246 255:252:252
+-4.11246 255:252:252
+-4 253:253:255
+4.11246 255:252:252
+4.22807 255:247:247
+-4.22807 255:247:247
+-4.11246 255:252:252
+4.22807 255:247:247
+4.34694 255:241:241
+-4.34694 255:241:241
+-4.22807 255:247:247
+4.34694 255:241:241
+4.46915 255:236:236
+-4.46915 255:236:236
+-4.34694 255:241:241
+4.46915 255:236:236
+4.59479 255:231:231
+-4.59479 255:231:231
+-4.46915 255:236:236
+4.59479 255:231:231
+4.72397 255:226:226
+-4.72397 255:226:226
+-4.59479 255:231:231
+4.72397 255:226:226
+4.85678 255:221:221
+-4.85678 255:221:221
+-4.72397 255:226:226
+4.85678 255:221:221
+4.99332 255:216:216
+-4.99332 255:216:216
+-4.85678 255:221:221
+4.99332 255:216:216
+5.1337 255:211:211
+-5.1337 255:211:211
+-4.99332 255:216:216
+5.1337 255:211:211
+5.27803 255:206:206
+-5.27803 255:206:206
+-5.1337 255:211:211
+5.27803 255:206:206
+5.42642 255:200:200
+-5.42642 255:200:200
+-5.27803 255:206:206
+5.42642 255:200:200
+5.57897 255:195:195
+-5.57897 255:195:195
+-5.42642 255:200:200
+5.57897 255:195:195
+5.73582 255:190:190
+-5.73582 255:190:190
+-5.57897 255:195:195
+5.73582 255:190:190
+5.89708 255:185:185
+-5.89708 255:185:185
+-5.73582 255:190:190
+5.89708 255:185:185
+6.06287 255:180:180
+-6.06287 255:180:180
+-5.89708 255:185:185
+6.06287 255:180:180
+6.23332 255:175:175
+-6.23332 255:175:175
+-6.06287 255:180:180
+6.23332 255:175:175
+6.40856 255:170:170
+-6.40856 255:170:170
+-6.23332 255:175:175
+6.40856 255:170:170
+6.58873 255:165:165
+-6.58873 255:165:165
+-6.40856 255:170:170
+6.58873 255:165:165
+6.77396 255:159:159
+-6.77396 255:159:159
+-6.58873 255:165:165
+6.77396 255:159:159
+6.9644 255:154:154
+-6.9644 255:154:154
+-6.77396 255:159:159
+6.9644 255:154:154
+7.1602 255:149:149
+-7.1602 255:149:149
+-6.9644 255:154:154
+7.1602 255:149:149
+7.3615 255:144:144
+-7.3615 255:144:144
+-7.1602 255:149:149
+7.3615 255:144:144
+7.56846 255:139:139
+-7.56846 255:139:139
+-7.3615 255:144:144
+7.56846 255:139:139
+7.78124 255:134:134
+-7.78124 255:134:134
+-7.56846 255:139:139
+7.78124 255:134:134
+8 255:129:129
+-8 255:129:129
+-7.78124 255:134:134
+8 255:129:129
+8.22491 255:124:124
+-8.22491 255:124:124
+-8 255:129:129
+8.22491 255:124:124
+8.45614 255:118:118
+-8.45614 255:118:118
+-8.22491 255:124:124
+8.45614 255:118:118
+8.69388 255:113:113
+-8.69388 255:113:113
+-8.45614 255:118:118
+8.69388 255:113:113
+8.9383 255:108:108
+-8.9383 255:108:108
+-8.69388 255:113:113
+8.9383 255:108:108
+9.18959 255:103:103
+-9.18959 255:103:103
+-8.9383 255:108:108
+9.18959 255:103:103
+9.44794 255:98:98
+-9.44794 255:98:98
+-9.18959 255:103:103
+9.44794 255:98:98
+9.71356 255:93:93
+-9.71356 255:93:93
+-9.44794 255:98:98
+9.71356 255:93:93
+9.98664 255:88:88
+-9.98664 255:88:88
+-9.71356 255:93:93
+9.98664 255:88:88
+10.2674 255:83:83
+-10.2674 255:83:83
+-9.98664 255:88:88
+10.2674 255:83:83
+10.5561 255:77:77
+-10.5561 255:77:77
+-10.2674 255:83:83
+10.5561 255:77:77
+10.8528 255:72:72
+-10.8528 255:72:72
+-10.5561 255:77:77
+10.8528 255:72:72
+11.1579 255:67:67
+-11.1579 255:67:67
+-10.8528 255:72:72
+11.1579 255:67:67
+11.4716 255:62:62
+-11.4716 255:62:62
+-11.1579 255:67:67
+11.4716 255:62:62
+11.7942 255:57:57
+-11.7942 255:57:57
+-11.4716 255:62:62
+11.7942 255:57:57
+12.1257 255:52:52
+-12.1257 255:52:52
+-11.7942 255:57:57
+12.1257 255:52:52
+12.4666 255:47:47
+-12.4666 255:47:47
+-12.1257 255:52:52
+12.4666 255:47:47
+12.8171 255:42:42
+-12.8171 255:42:42
+-12.4666 255:47:47
+12.8171 255:42:42
+13.1775 255:36:36
+-13.1775 255:36:36
+-12.8171 255:42:42
+13.1775 255:36:36
+13.5479 255:31:31
+-13.5479 255:31:31
+-13.1775 255:36:36
+13.5479 255:31:31
+13.9288 255:26:26
+-13.9288 255:26:26
+-13.5479 255:31:31
+13.9288 255:26:26
+14.3204 255:21:21
+-14.3204 255:21:21
+-13.9288 255:26:26
+14.3204 255:21:21
+14.723 255:16:16
+-14.723 255:16:16
+-14.3204 255:21:21
+14.723 255:16:16
+15.1369 255:11:11
+-15.1369 255:11:11
+-14.723 255:16:16
+15 255:1:1
+15.5625 255:6:6
+-15.5625 255:6:6
+-15 255:1:1
+nv 255:255:255
+default 255:255:255

Added: grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_logscale.ref
===================================================================
--- grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_logscale.ref	                        (rev 0)
+++ grass/trunk/raster/r.colors/tests/test_elev_double_maps_difference_logscale.ref	2012-11-01 18:21:17 UTC (rev 53640)
@@ -0,0 +1,2 @@
+nv 255:255:255
+default 255:255:255

Added: grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_1.ref
===================================================================
--- grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_1.ref	                        (rev 0)
+++ grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_1.ref	2012-11-01 18:21:17 UTC (rev 53640)
@@ -0,0 +1,5 @@
+-14 0:0:255
+0 255:255:255
+14 255:0:0
+nv 255:255:255
+default 255:255:255

Added: grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_hist.ref
===================================================================
--- grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_hist.ref	                        (rev 0)
+++ grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_hist.ref	2012-11-01 18:21:17 UTC (rev 53640)
@@ -0,0 +1,31 @@
+-14 6:6:255
+-13 19:19:255
+-12 32:32:255
+-11 42:42:255
+-10 48:48:255
+-9 52:52:255
+-8 59:59:255
+-7 67:67:255
+-6 72:72:255
+-5 77:77:255
+-4 87:87:255
+-3 100:100:255
+-2 107:107:255
+-1 114:114:255
+0 138:138:255
+1 174:174:255
+2 202:202:255
+3 223:223:255
+4 242:242:255
+5 255:234:234
+6 255:191:191
+7 255:163:163
+8 255:132:132
+9 255:101:101
+10 255:77:77
+11 255:58:58
+12 255:45:45
+13 255:26:26
+14 255:7:7
+nv 255:255:255
+default 255:255:255

Added: grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_invert.ref
===================================================================
--- grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_invert.ref	                        (rev 0)
+++ grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_invert.ref	2012-11-01 18:21:17 UTC (rev 53640)
@@ -0,0 +1,5 @@
+-14 0:0:255
+0 255:255:255
+14 255:0:0
+nv 255:255:255
+default 255:255:255

Added: grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_logabsscale.ref
===================================================================
--- grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_logabsscale.ref	                        (rev 0)
+++ grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_logabsscale.ref	2012-11-01 18:21:17 UTC (rev 53640)
@@ -0,0 +1,398 @@
+1 0:0:255
+1.02745 5:5:255
+-1.02745 5:5:255
+-1 0:0:255
+1.02745 5:5:255
+1.05565 10:10:255
+-1.05565 10:10:255
+-1.02745 5:5:255
+1.05565 10:10:255
+1.08463 15:15:255
+-1.08463 15:15:255
+-1.05565 10:10:255
+1.08463 15:15:255
+1.11441 20:20:255
+-1.11441 20:20:255
+-1.08463 15:15:255
+1.11441 20:20:255
+1.145 25:25:255
+-1.145 25:25:255
+-1.11441 20:20:255
+1.145 25:25:255
+1.17643 30:30:255
+-1.17643 30:30:255
+-1.145 25:25:255
+1.17643 30:30:255
+1.20872 35:35:255
+-1.20872 35:35:255
+-1.17643 30:30:255
+1.20872 35:35:255
+1.2419 40:40:255
+-1.2419 40:40:255
+-1.20872 35:35:255
+1.2419 40:40:255
+1.27599 45:45:255
+-1.27599 45:45:255
+-1.2419 40:40:255
+1.27599 45:45:255
+1.31102 51:51:255
+-1.31102 51:51:255
+-1.27599 45:45:255
+1.31102 51:51:255
+1.34701 56:56:255
+-1.34701 56:56:255
+-1.31102 51:51:255
+1.34701 56:56:255
+1.38398 61:61:255
+-1.38398 61:61:255
+-1.34701 56:56:255
+1.38398 61:61:255
+1.42197 66:66:255
+-1.42197 66:66:255
+-1.38398 61:61:255
+1.42197 66:66:255
+1.46101 71:71:255
+-1.46101 71:71:255
+-1.42197 66:66:255
+1.46101 71:71:255
+1.50111 76:76:255
+-1.50111 76:76:255
+-1.46101 71:71:255
+1.50111 76:76:255
+1.54232 81:81:255
+-1.54232 81:81:255
+-1.50111 76:76:255
+1.54232 81:81:255
+1.58466 86:86:255
+-1.58466 86:86:255
+-1.54232 81:81:255
+1.58466 86:86:255
+1.62816 91:91:255
+-1.62816 91:91:255
+-1.58466 86:86:255
+1.62816 91:91:255
+1.67285 96:96:255
+-1.67285 96:96:255
+-1.62816 91:91:255
+1.67285 96:96:255
+1.71877 102:102:255
+-1.71877 102:102:255
+-1.67285 96:96:255
+1.71877 102:102:255
+1.76595 107:107:255
+-1.76595 107:107:255
+-1.71877 102:102:255
+1.76595 107:107:255
+1.81443 112:112:255
+-1.81443 112:112:255
+-1.76595 107:107:255
+1.81443 112:112:255
+1.86424 117:117:255
+-1.86424 117:117:255
+-1.81443 112:112:255
+1.86424 117:117:255
+1.91541 122:122:255
+-1.91541 122:122:255
+-1.86424 117:117:255
+1.91541 122:122:255
+1.96799 127:127:255
+-1.96799 127:127:255
+-1.91541 122:122:255
+1.96799 127:127:255
+2.02201 132:132:255
+-2.02201 132:132:255
+-1.96799 127:127:255
+2.02201 132:132:255
+2.07752 137:137:255
+-2.07752 137:137:255
+-2.02201 132:132:255
+2.07752 137:137:255
+2.13455 142:142:255
+-2.13455 142:142:255
+-2.07752 137:137:255
+2.13455 142:142:255
+2.19314 147:147:255
+-2.19314 147:147:255
+-2.13455 142:142:255
+2.19314 147:147:255
+2.25334 153:153:255
+-2.25334 153:153:255
+-2.19314 147:147:255
+2.25334 153:153:255
+2.3152 158:158:255
+-2.3152 158:158:255
+-2.25334 153:153:255
+2.3152 158:158:255
+2.37875 163:163:255
+-2.37875 163:163:255
+-2.3152 158:158:255
+2.37875 163:163:255
+2.44405 168:168:255
+-2.44405 168:168:255
+-2.37875 163:163:255
+2.44405 168:168:255
+2.51114 173:173:255
+-2.51114 173:173:255
+-2.44405 168:168:255
+2.51114 173:173:255
+2.58007 178:178:255
+-2.58007 178:178:255
+-2.51114 173:173:255
+2.58007 178:178:255
+2.6509 183:183:255
+-2.6509 183:183:255
+-2.58007 178:178:255
+2.6509 183:183:255
+2.72367 188:188:255
+-2.72367 188:188:255
+-2.6509 183:183:255
+2.72367 188:188:255
+2.79843 193:193:255
+-2.79843 193:193:255
+-2.72367 188:188:255
+2.79843 193:193:255
+2.87525 198:198:255
+-2.87525 198:198:255
+-2.79843 193:193:255
+2.87525 198:198:255
+2.95418 204:204:255
+-2.95418 204:204:255
+-2.87525 198:198:255
+2.95418 204:204:255
+3.03527 209:209:255
+-3.03527 209:209:255
+-2.95418 204:204:255
+3.03527 209:209:255
+3.11859 214:214:255
+-3.11859 214:214:255
+-3.03527 209:209:255
+3.11859 214:214:255
+3.2042 219:219:255
+-3.2042 219:219:255
+-3.11859 214:214:255
+3.2042 219:219:255
+3.29215 224:224:255
+-3.29215 224:224:255
+-3.2042 219:219:255
+3.29215 224:224:255
+3.38253 229:229:255
+-3.38253 229:229:255
+-3.29215 224:224:255
+3.38253 229:229:255
+3.47538 234:234:255
+-3.47538 234:234:255
+-3.38253 229:229:255
+3.47538 234:234:255
+3.57078 239:239:255
+-3.57078 239:239:255
+-3.47538 234:234:255
+3.57078 239:239:255
+3.6688 244:244:255
+-3.6688 244:244:255
+-3.57078 239:239:255
+3.6688 244:244:255
+3.76951 249:249:255
+-3.76951 249:249:255
+-3.6688 244:244:255
+3.76951 249:249:255
+3.87298 255:255:255
+-3.87298 255:255:255
+-3.76951 249:249:255
+3.87298 255:255:255
+3.9793 255:250:250
+-3.9793 255:250:250
+-3.87298 255:255:255
+3.9793 255:250:250
+4.08853 255:245:245
+-4.08853 255:245:245
+-3.9793 255:250:250
+4.08853 255:245:245
+4.20076 255:240:240
+-4.20076 255:240:240
+-4.08853 255:245:245
+4.20076 255:240:240
+4.31608 255:235:235
+-4.31608 255:235:235
+-4.20076 255:240:240
+4.31608 255:235:235
+4.43456 255:230:230
+-4.43456 255:230:230
+-4.31608 255:235:235
+4.43456 255:230:230
+4.55629 255:225:225
+-4.55629 255:225:225
+-4.43456 255:230:230
+4.55629 255:225:225
+4.68136 255:220:220
+-4.68136 255:220:220
+-4.55629 255:225:225
+4.68136 255:220:220
+4.80987 255:215:215
+-4.80987 255:215:215
+-4.68136 255:220:220
+4.80987 255:215:215
+4.9419 255:210:210
+-4.9419 255:210:210
+-4.80987 255:215:215
+4.9419 255:210:210
+5.07756 255:204:204
+-5.07756 255:204:204
+-4.9419 255:210:210
+5.07756 255:204:204
+5.21694 255:199:199
+-5.21694 255:199:199
+-5.07756 255:204:204
+5.21694 255:199:199
+5.36015 255:194:194
+-5.36015 255:194:194
+-5.21694 255:199:199
+5.36015 255:194:194
+5.50728 255:189:189
+-5.50728 255:189:189
+-5.36015 255:194:194
+5.50728 255:189:189
+5.65846 255:184:184
+-5.65846 255:184:184
+-5.50728 255:189:189
+5.65846 255:184:184
+5.81379 255:179:179
+-5.81379 255:179:179
+-5.65846 255:184:184
+5.81379 255:179:179
+5.97338 255:174:174
+-5.97338 255:174:174
+-5.81379 255:179:179
+5.97338 255:174:174
+6.13735 255:169:169
+-6.13735 255:169:169
+-5.97338 255:174:174
+6.13735 255:169:169
+6.30583 255:164:164
+-6.30583 255:164:164
+-6.13735 255:169:169
+6.30583 255:164:164
+6.47893 255:159:159
+-6.47893 255:159:159
+-6.30583 255:164:164
+6.47893 255:159:159
+6.65678 255:153:153
+-6.65678 255:153:153
+-6.47893 255:159:159
+6.65678 255:153:153
+6.83951 255:148:148
+-6.83951 255:148:148
+-6.65678 255:153:153
+6.83951 255:148:148
+7.02725 255:143:143
+-7.02725 255:143:143
+-6.83951 255:148:148
+7.02725 255:143:143
+7.22016 255:138:138
+-7.22016 255:138:138
+-7.02725 255:143:143
+7.22016 255:138:138
+7.41835 255:133:133
+-7.41835 255:133:133
+-7.22016 255:138:138
+7.41835 255:133:133
+7.62199 255:128:128
+-7.62199 255:128:128
+-7.41835 255:133:133
+7.62199 255:128:128
+7.83122 255:123:123
+-7.83122 255:123:123
+-7.62199 255:128:128
+7.83122 255:123:123
+8.04619 255:118:118
+-8.04619 255:118:118
+-7.83122 255:123:123
+8.04619 255:118:118
+8.26706 255:113:113
+-8.26706 255:113:113
+-8.04619 255:118:118
+8.26706 255:113:113
+8.494 255:108:108
+-8.494 255:108:108
+-8.26706 255:113:113
+8.494 255:108:108
+8.72716 255:103:103
+-8.72716 255:103:103
+-8.494 255:108:108
+8.72716 255:103:103
+8.96673 255:97:97
+-8.96673 255:97:97
+-8.72716 255:103:103
+8.96673 255:97:97
+9.21287 255:92:92
+-9.21287 255:92:92
+-8.96673 255:97:97
+9.21287 255:92:92
+9.46577 255:87:87
+-9.46577 255:87:87
+-9.21287 255:92:92
+9.46577 255:87:87
+9.72561 255:82:82
+-9.72561 255:82:82
+-9.46577 255:87:87
+9.72561 255:82:82
+9.99258 255:77:77
+-9.99258 255:77:77
+-9.72561 255:82:82
+9.99258 255:77:77
+10.2669 255:72:72
+-10.2669 255:72:72
+-9.99258 255:77:77
+10.2669 255:72:72
+10.5487 255:67:67
+-10.5487 255:67:67
+-10.2669 255:72:72
+10.5487 255:67:67
+10.8383 255:62:62
+-10.8383 255:62:62
+-10.5487 255:67:67
+10.8383 255:62:62
+11.1358 255:57:57
+-11.1358 255:57:57
+-10.8383 255:62:62
+11.1358 255:57:57
+11.4415 255:51:51
+-11.4415 255:51:51
+-11.1358 255:57:57
+11.4415 255:51:51
+11.7556 255:46:46
+-11.7556 255:46:46
+-11.4415 255:51:51
+11.7556 255:46:46
+12.0782 255:41:41
+-12.0782 255:41:41
+-11.7556 255:46:46
+12.0782 255:41:41
+12.4098 255:36:36
+-12.4098 255:36:36
+-12.0782 255:41:41
+12.4098 255:36:36
+12.7505 255:31:31
+-12.7505 255:31:31
+-12.4098 255:36:36
+12.7505 255:31:31
+13.1005 255:26:26
+-13.1005 255:26:26
+-12.7505 255:31:31
+13.1005 255:26:26
+13.4601 255:21:21
+-13.4601 255:21:21
+-13.1005 255:26:26
+13.4601 255:21:21
+13.8296 255:16:16
+-13.8296 255:16:16
+-13.4601 255:21:21
+13.8296 255:16:16
+14.2092 255:11:11
+-14.2092 255:11:11
+-13.8296 255:16:16
+14 255:0:0
+14.5992 255:6:6
+-14.5992 255:6:6
+-14 255:0:0
+nv 255:255:255
+default 255:255:255

Added: grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_logscale.ref
===================================================================
--- grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_logscale.ref	                        (rev 0)
+++ grass/trunk/raster/r.colors/tests/test_elev_int_maps_difference_logscale.ref	2012-11-01 18:21:17 UTC (rev 53640)
@@ -0,0 +1,2 @@
+nv 255:255:255
+default 255:255:255

Added: grass/trunk/raster/r.colors/tests/test_elev_int_maps_grey_eq.ref
===================================================================
--- grass/trunk/raster/r.colors/tests/test_elev_int_maps_grey_eq.ref	                        (rev 0)
+++ grass/trunk/raster/r.colors/tests/test_elev_int_maps_grey_eq.ref	2012-11-01 18:21:17 UTC (rev 53640)
@@ -0,0 +1,31 @@
+-14 3:3:3
+-13 9:9:9
+-12 16:16:16
+-11 21:21:21
+-10 24:24:24
+-9 26:26:26
+-8 29:29:29
+-7 33:33:33
+-6 36:36:36
+-5 38:38:38
+-4 44:44:44
+-3 50:50:50
+-2 54:54:54
+-1 57:57:57
+0 69:69:69
+1 87:87:87
+2 101:101:101
+3 112:112:112
+4 121:121:121
+5 138:138:138
+6 160:160:160
+7 174:174:174
+8 190:190:190
+9 205:205:205
+10 217:217:217
+11 227:227:227
+12 233:233:233
+13 243:243:243
+14 252:252:252
+nv 255:255:255
+default 255:255:255

Added: grass/trunk/raster/r.colors/tests/test_elev_int_maps_grey_log.ref
===================================================================
--- grass/trunk/raster/r.colors/tests/test_elev_int_maps_grey_log.ref	                        (rev 0)
+++ grass/trunk/raster/r.colors/tests/test_elev_int_maps_grey_log.ref	2012-11-01 18:21:17 UTC (rev 53640)
@@ -0,0 +1,4 @@
+0 0:0:0
+14 0:0:0
+nv 255:255:255
+default 255:255:255

Added: grass/trunk/raster/r.colors/tests/test_elev_int_maps_random.ref
===================================================================
--- grass/trunk/raster/r.colors/tests/test_elev_int_maps_random.ref	                        (rev 0)
+++ grass/trunk/raster/r.colors/tests/test_elev_int_maps_random.ref	2012-11-01 18:21:17 UTC (rev 53640)
@@ -0,0 +1,31 @@
+1 132:170:94
+2 90:39:207
+3 112:182:187
+4 220:49:105
+5 178:194:220
+6 247:60:73
+7 87:190:157
+8 73:216:60
+9 248:184:53
+10 206:207:29
+11 202:83:200
+12 40:174:239
+13 247:30:165
+14 178:250:215
+15 28:172:153
+16 248:163:213
+17 65:250:147
+18 223:67:108
+19 27:60:36
+20 81:10:243
+21 110:212:71
+22 54:252:245
+23 37:243:19
+24 203:166:13
+25 162:194:185
+26 59:186:93
+27 17:252:87
+28 164:219:155
+29 16:246:215
+nv 255:255:255
+default 255:255:255



More information about the grass-commit mailing list