[GRASS-SVN] r62802 - in grass/branches/releasebranch_7_0: . scripts/r.rgb

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Nov 18 09:01:39 PST 2014


Author: martinl
Date: 2014-11-18 09:01:38 -0800 (Tue, 18 Nov 2014)
New Revision: 62802

Modified:
   grass/branches/releasebranch_7_0/
   grass/branches/releasebranch_7_0/scripts/r.rgb/r.rgb.html
   grass/branches/releasebranch_7_0/scripts/r.rgb/r.rgb.py
Log:
r.rgb: output_prefix -> basename
       add example
       (merge r62800-1 from trunk)



Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Modified: svn:mergeinfo
   - /grass/trunk:60817,61096,61141,62179-62180,62182,62403,62422,62424,62437,62466,62469,62487,62491,62494,62501,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562,62566,62570,62573,62575,62585,62588,62597,62603,62606,62608-62609,62614,62618,62628,62632,62638,62642,62648-62649,62652,62654-62657,62666,62691,62705,62709,62723,62730,62739,62741,62743,62746,62750,62752,62757,62762,62785,62798
   + /grass/trunk:60817,61096,61141,62179-62180,62182,62403,62422,62424,62437,62466,62469,62487,62491,62494,62501,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562,62566,62570,62573,62575,62585,62588,62597,62603,62606,62608-62609,62614,62618,62628,62632,62638,62642,62648-62649,62652,62654-62657,62666,62691,62705,62709,62723,62730,62739,62741,62743,62746,62750,62752,62757,62762,62785,62798,62800-62801

Modified: grass/branches/releasebranch_7_0/scripts/r.rgb/r.rgb.html
===================================================================
--- grass/branches/releasebranch_7_0/scripts/r.rgb/r.rgb.html	2014-11-18 16:57:19 UTC (rev 62801)
+++ grass/branches/releasebranch_7_0/scripts/r.rgb/r.rgb.html	2014-11-18 17:01:38 UTC (rev 62802)
@@ -1,8 +1,17 @@
 <h2>DESCRIPTION</h2>
 
-<em>r.rgb</em> is a script that generates separate red, green and blue
-maps from a raster map and its associated color table.
+<em>r.rgb</em> generates separate red, green and blue maps from a
+raster map and its associated color table (grey255).
 
+<h2>EXAMPLE</h2>
+
+<div class="code"><pre>
+r.rgb input=elevation
+</pre></div>
+
+In this case <em>r.rgb</em> produces in the current mapset three new
+raster maps - 'elevation.r', 'elevation.g', 'elevation.b'.
+
 <h2>SEE ALSO</h2>
 
 <em>
@@ -16,4 +25,5 @@
 
 Glynn Clements
 
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>

Modified: grass/branches/releasebranch_7_0/scripts/r.rgb/r.rgb.py
===================================================================
--- grass/branches/releasebranch_7_0/scripts/r.rgb/r.rgb.py	2014-11-18 16:57:19 UTC (rev 62801)
+++ grass/branches/releasebranch_7_0/scripts/r.rgb/r.rgb.py	2014-11-18 17:01:38 UTC (rev 62802)
@@ -20,10 +20,8 @@
 #%end
 #%option G_OPT_R_INPUT
 #%end
-#%option
-#% key: output_prefix
-#% type: string
-#% description: Prefix for output raster maps (default: input)
+#%option G_OPT_R_BASENAME_OUTPUT
+#% description: Default: input
 #% required: no
 #%end
 
@@ -31,7 +29,7 @@
 
 def main():
     input = options['input']
-    output = options['output_prefix']
+    output = options['basename']
 
     if not grass.find_file(input)['file']:
 	grass.fatal(_("Raster map <%s> not found") % input)
@@ -46,7 +44,7 @@
 
     for ch in ['r', 'g', 'b']:
 	name = "%s.%s" % (output, ch)
-	grass.run_command('r.colors', map = name, color = 'grey255')
+	grass.run_command('r.colors', map = name, color = 'grey255', quiet = True)
 	grass.raster_history(name)
 
 if __name__ == "__main__":



More information about the grass-commit mailing list