Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 413e0bdb3c48563b2d8d9038d07d5533 > files > 2084

grass-6.3.0-15.fc13.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>GRASS GIS: r.recode</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="grassdocs.css" type="text/css">
</head>
<body bgcolor="white">

<img src="grass_logo.png" alt="GRASS logo"><hr align=center size=6 noshade>

<h2>NAME</h2>
<em><b>r.recode</b></em>  - Recodes categorical raster maps.
<h2>KEYWORDS</h2>
raster
<h2>SYNOPSIS</h2>
<b>r.recode</b><br>
<b>r.recode help</b><br>
<b>r.recode</b> [-<b>ad</b>] <b>input</b>=<em>name</em> <b>output</b>=<em>name</em>  [<b>rules</b>=<em>name</em>]   [<b>title</b>=<em>string</em>]   [--<b>overwrite</b>]  [--<b>verbose</b>]  [--<b>quiet</b>] 

<h3>Flags:</h3>
<DL>
<DT><b>-a</b></DT>
<DD>Align the current region to the input map</DD>

<DT><b>-d</b></DT>
<DD>Force output to double map type (DCELL)</DD>

<DT><b>--overwrite</b></DT>
<DD>Allow output files to overwrite existing files</DD>
<DT><b>--verbose</b></DT>
<DD>Verbose module output</DD>
<DT><b>--quiet</b></DT>
<DD>Quiet module output</DD>
</DL>

<h3>Parameters:</h3>
<DL>
<DT><b>input</b>=<em>name</em></DT>
<DD>Raster map to be recoded</DD>

<DT><b>output</b>=<em>name</em></DT>
<DD>Name for output raster map</DD>

<DT><b>rules</b>=<em>name</em></DT>
<DD>File containing recode rules</DD>

<DT><b>title</b>=<em>string</em></DT>
<DD>Title for the resulting raster map</DD>

</DL>
<H2>DESCRIPTION</H2>

<em>r.recode</em> creates an output map layer based on an input raster map
layer. The output map layer will be a recoding of the input map layer based
on recode rules input to <em>r.recode</em>. A <em>title</em> for the output
map layer may be (optionally) specified by the user.<p>

The recode  rules are read from standard input (i.e., from the keyboard,
redirected from a file, or piped through another program).<p>

The program will be run non-interactively if the user specifies the name of
the raster map layer to be recoded, the <em>name</em> of an output layer to
hold recoded map, and (optionally) the name of a title for the output map.

Rules are defined in one of these formats:
<PRE>
    old_low:old_high:new_low:new_high
    old_low:old_high:new_val  (i.e. new_high == new_low)
    *:old_val:new_val         (interval [inf, old_val])
    old_val:*:new_val         (interval [old_val, inf])
</PRE>

<em>r.recode</em> is loosely based on r.reclass and uses the GRASS reclass
library to convert the rasters. It has routines for converting to every
possible combination of raster (eg. int to double, double to float, etc).
Standard floating point raster precision is float, with <em>-d</em> double
precision will be written.<br>
There are four basic routines that it accepts:

<ol>
<li>old-low to old-high is reclassed to new-low to new high , where the
user provides all four values. The program figures on the fly what type of
raster should be created.
                                                                                
<li>old-low to old-high is reclassed to a single new value. Anything outside
the range is null.

<li> * to old-high will reclass everything less than old-high to a single
new value.

<li> old-low to * will reclass everything greater than old-low to a single
new value.
</ol>

These four sets of arguments can be given on the command line, or piped via
stdin or a file. More than one set of arguments is accepted.

<h2>EXAMPLES</H2>

<b>Map type conversion</b><br>

To simply convert a raster between formats (eg. int to float) the user would
use the first argument. For example <br>

<tt>10:1500:0.1:15.0</tt><br>

 would convert an old raster with range between 10 and 1500 to a float
raster with range bewteen 0.1 and 15.0. <p>

<b>Value replacement</b><br>

r.recode can be used to replace existing cell values by others. The
formatting is as described above. In following example the values 1, 2 and
3 are replaced by 1.1, 7.5 resp. 0.4:<br>

<pre>
    r.recode in=oldmap out=newmap &lt;&lt; EOF
    1:1:1.1:1.1
    2:2:7.5:7.5
    3:3:0.4:0.4
    EOF
</pre>


<H2>AUTHOR</H2>
CERL

<p><i>Last changed: $Date: 2003-05-06 17:35:18 +0200 (Tue, 06 May 2003) $</i>
<HR>
<P><a href="index.html">Main index</a> - <a href="raster.html">raster index</a> - <a href="full_index.html">Full index</a></P>
<P>&copy; 2003-2008 <a href="http://grass.osgeo.org">GRASS Development Team</a></p>
</body>
</html>