[GRASS-SVN] r43563 -
grass/branches/releasebranch_6_4/raster/r.colors
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Sep 21 06:39:25 EDT 2010
Author: neteler
Date: 2010-09-21 10:39:25 +0000 (Tue, 21 Sep 2010)
New Revision: 43563
Modified:
grass/branches/releasebranch_6_4/raster/r.colors/Makefile
grass/branches/releasebranch_6_4/raster/r.colors/description.html
grass/branches/releasebranch_6_4/raster/r.colors/main.c
Log:
backport: allow color=rules rules=file.txt; HTML cosmetics
Modified: grass/branches/releasebranch_6_4/raster/r.colors/Makefile
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.colors/Makefile 2010-09-21 10:37:32 UTC (rev 43562)
+++ grass/branches/releasebranch_6_4/raster/r.colors/Makefile 2010-09-21 10:39:25 UTC (rev 43563)
@@ -9,3 +9,10 @@
default: cmd
+# Insert thumbnail previews
+# Try overriding the default rule with:
+#r.colors.tmp.html: $(HTMLSRC)
+# $(call htmldesc,$<,$@)
+# sed 's!^<DD><b>\([a-z0-9.]*\)</b>:!<DD><img width="80" height="12" \
+# src="Colortable_\1_i.png"><b>\1</b>:!' $@ > $@.tmp
+# mv -f $@.tmp $@
Modified: grass/branches/releasebranch_6_4/raster/r.colors/description.html
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.colors/description.html 2010-09-21 10:37:32 UTC (rev 43562)
+++ grass/branches/releasebranch_6_4/raster/r.colors/description.html 2010-09-21 10:39:25 UTC (rev 43563)
@@ -3,45 +3,7 @@
<i>r.colors</i> allows the user to create and/or modify the color table for a
raster map layer. The map layer (specified on the command line by
<b>map=</b><i>name</i>) must exist in the user's current mapset search path.
-The color table specified by <b>color=</b><i>type</i> must be one of the
-following:
-<pre>
- color type description
- -----------+----------------------------------------------------------
- aspect aspect oriented grey colors
- aspectcolr aspect oriented rainbow colors
- bcyr blue through cyan through yellow to red
- bgyr blue through green through yellow to red
- byg blue through yellow to green
- byr blue through yellow to red
- celsius blue to red for degree Celsius temperature
- curvature for terrain curvatures (from v.surf.rst and r.slope.aspect)
- differences differences oriented colors
- elevation maps relative ranges of raster values to elevation color ramp
- etopo2 colors for ETOPO2 worldwide bathymetry/topography
- evi enhanced vegetative index colors
- grey grey scale
- grey1.0 grey scale for raster values between 0.0-1.0
- grey255 grey scale for raster values bewtween 0-255
- gyr green through yellow to red
- ndvi Normalized Difference Vegetation Index colors
- population color table covering human population classification breaks
- rainbow rainbow color table
- ramp color ramp
- ryb red through yellow to blue
- ryg red through yellow to green
- sepia yellowish-brown through to white
- slope r.slope.aspect-type slope colors for raster values 0-90
- srtm color palette for Shuttle Radar Topography Mission elevation
- terrain global elevation color table covering -11000 to +8850m
- wave color wave
- random random color table
- grey.eq histogram-equalized grey scale
- grey.log histogram logarithmic transformed grey scale
- rules create new color table based on user-specified rules read from stdin
-</pre>
-
<p>
The <b>rast</b> option allows user to specify a raster map <i>name</i> from which
to copy the color map.
Modified: grass/branches/releasebranch_6_4/raster/r.colors/main.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.colors/main.c 2010-09-21 10:37:32 UTC (rev 43562)
+++ grass/branches/releasebranch_6_4/raster/r.colors/main.c 2010-09-21 10:39:25 UTC (rev 43563)
@@ -273,11 +273,16 @@
if (interactive && (style || rules || cmap))
G_fatal_error(_("Interactive mode is incompatible with \"color\", \"rules\", and \"raster\" options"));
- if ((style && (cmap || rules)) || (cmap && rules))
- G_fatal_error(_("\"color\", \"rules\", and \"raster\" options are mutually exclusive"));
+ if ((style && (cmap || rules)) || (cmap && rules)) {
+ if ((style && rules && !cmap) && strcmp(style, "rules") == 0)
+ style = NULL;
+ else
+ G_fatal_error(
+ _("\"color\", \"rules\", and \"raster\" options are mutually exclusive"));
+ }
/* handle rules="-" (from stdin) by translating that to colors=rules */
- /* this method should not be ported to GRASS 7 where color=rules DNE */
+ /* this method should not be ported to GRASS 7 verbatim, as color=rules DNE */
if (rules && strcmp(rules, "-") == 0) {
style = G_store("rules");
rules = NULL;
More information about the grass-commit
mailing list