[GRASS-SVN] r63519 - grass-addons/grass7/raster/r.recode.attr

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Dec 13 05:42:07 PST 2014


Author: pvanbosgeo
Date: 2014-12-13 05:42:07 -0800 (Sat, 13 Dec 2014)
New Revision: 63519

Modified:
   grass-addons/grass7/raster/r.recode.attr/r.recode.attr.html
   grass-addons/grass7/raster/r.recode.attr/r.recode.attr.py
Log:
Improvement manual page and description

Modified: grass-addons/grass7/raster/r.recode.attr/r.recode.attr.html
===================================================================
--- grass-addons/grass7/raster/r.recode.attr/r.recode.attr.html	2014-12-13 11:16:22 UTC (rev 63518)
+++ grass-addons/grass7/raster/r.recode.attr/r.recode.attr.html	2014-12-13 13:42:07 UTC (rev 63519)
@@ -1,14 +1,32 @@
 
 <h2>DESCRIPTION</h2>
 
-<em>r.recode.attr</em> is a wrapper for r.recode which makes it easier to recode a raster layer based on values in a csv table. The csv file should include at least two columns. The first column should correspond to (part of) the raster values. The other columns should hold the reclassification values. 
+The <em>r.reclass.attr</em> plugin let you reclass/recode a raster layer based on values in a csv table. The csv file should include at least two columns. The first column should correspond to (part of) the raster values. The other columns should hold the reclassification values. 
 
-<p>For each column in the csv file (except the first one) a new map will be created. This is done by creating recode rules as follows <i>old:old:new</i>. See the help file for <a href="http://grass.osgeo.org/grass70/manuals/r.recode.html">r.recode</a> for more information.
+<p>For each column in the csv (comma separated text) file (except the first one) a new map will be created, replacing the raster values corresponding to the first column with those in the second (3rd, 4th, etc) column. 
 
 <p>The user can define the names of the output map(s). If only one output name is provided and the rules file contains more than two columns, the function will create output names by appending for each recode layer the corresponding column name to the output name provided by the user. 
+
+<h2>NOTES</h2>
+The script uses r.recode to allow the user to reclass integer values to floating point values. However, like <a href="http://grass.osgeo.org/grass70/manuals/r.reclass.html">r.reclass</a> you can only convert number one to one (and not like <a href="http://grass.osgeo.org/grass70/manuals/r.recode.html">r.recode</a> ranges of values to one value or a new range of values)
+
+<h2>TODO</h2>
+<ul>
+    <li>Use r.reclass instead of r.recode when possible (if input raster is integer and all reclass values are integers)</li>
+    <li>Allow text files with different types of separators (now only comma separated files)</li>
+</ul>
+
+<h2>EXAMPLES</h2>
+
+<p>See <a href="http://pvanb.wordpress.com/2014/12/13/recode-your-ra…ing-a-csv-file/">this blog post</a> for an example.
+
  
+<h2>SEE ALSO</h2>
+<em><a href="http://grass.osgeo.org/grass70/manuals/r.reclass.html">r.reclass</a></em>, 
+<em><a href="http://grass.osgeo.org/grass70/manuals/r.recode.html">r.recode</a></em>
+ 
 <h2>AUTHOR</h2>
 
 Paulo van Breugel, paulo at ecodiv.org
 
-<i>Last changed: $Date$</i>
+<p><i>Last changed: $Date: 2014-12-13 09:11:08 +0100 (za, 13 dec 2014)</i></p>

Modified: grass-addons/grass7/raster/r.recode.attr/r.recode.attr.py
===================================================================
--- grass-addons/grass7/raster/r.recode.attr/r.recode.attr.py	2014-12-13 11:16:22 UTC (rev 63518)
+++ grass-addons/grass7/raster/r.recode.attr/r.recode.attr.py	2014-12-13 13:42:07 UTC (rev 63519)
@@ -5,12 +5,8 @@
 # 
 # MODULE:       r.recode_attribute
 # AUTHOR(S):    Paulo van Breugel <p.vanbreugel AT gmail.com>
-# PURPOSE:      Recode raster using attribute table (csv file) as input,
-#               using the reclass sheme old:old:new.               
-#               The first column of the table in the csv file is taken 
-#               to be the original value, the next columns are assumed
-#               to be the reclass values. The name of the new layer(s)
-#               are the output + column_name          
+# PURPOSE:      Recode raster to one or more new layers using an
+#               attribute table (csv file) as input     
 #
 # COPYRIGHT: (C) 2014 Paulo van Breugel
 #            http://ecodiv.org
@@ -40,7 +36,7 @@
 #% key: output
 #% type: string
 #% gisprompt: old,cell,raster
-#% description: basename output layer(s)
+#% description: name(s) output layer(s)
 #% key_desc: name
 #% required: yes
 #% multiple: no



More information about the grass-commit mailing list