r.recode(1)		      Grass User's Manual		   r.recode(1)



NNAAMMEE
       _r_._r_e_c_o_d_e - recode raster maps

       _(_G_R_A_S_S _R_a_s_t_e_r _P_r_o_g_r_a_m_)

SSYYNNOOPPSSIISS
       rr..rreeccooddee [--aadd] iinnppuutt_=_n_a_m_e oouuttppuutt_=_n_a_m_e [ttiittllee_=_n_a_m_e]

DDEESSCCRRIIPPTTIIOONN
       _r_._r_e_c_o_d_e  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 _r_._r_e_c_o_d_e. A _t_i_t_l_e for the output map
       layer may be (optionally) specified by the user.


       The recode  rules are read from standard input  (i.e.,  from  the  key-
       board, redirected from a file, or piped through another program).


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

   FFllaagg::
       --aa     Align the current region to the input map

       --dd     Force output to double map type (DCELL)


   PPaarraammeetteerrss::
       iinnppuutt  Raster map to be recoded

       oouuttppuutt Name for the resulting raster map

       ttiittllee  Title for the resulting raster map

       Enter a rule in one of these formats:

	   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])

       _r_._r_e_c_o_d_e 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 _-_d dou-
       ble precision will be written.

       There are four basic routines that it accepts:

	      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.

	      old-low to old-high is reclassed to a single new value. Anything
	      outside the range is null.

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

	       old-low to * will reclass everything greater than old-low to  a
	      single new value.

       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.

EEXXAAMMPPLLEESS
       MMaapp ttyyppee ccoonnvveerrssiioonn

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

       10:1500:0.1:15.0

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


       VVaalluuee rreeppllaacceemmeenntt

       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:


	   r.recode in=oldmap out=newmap << EOF
	   1:1:1.1:1.1
	   2:2:7.5:7.5
	   3:3:0.4:0.4
	   EOF


AAUUTTHHOORR
       CERL

       _L_a_s_t _c_h_a_n_g_e_d_: _$_D_a_t_e_: _2_0_0_2_/_0_3_/_0_1 _0_0_:_2_7_:_4_5 _$



GRASS 5.0							   r.recode(1)
