<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16625"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px" 
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true" 
name="Compose message area">
<DIV>
<DIV><FONT face=Calibri>Following code could be one approach:</FONT></DIV>
<DIV><FONT face=Calibri></FONT>&nbsp;</DIV>
<DIV><FONT face=Calibri>os.system("cat %s | r.recode input=map_a 
output=map_recl" % path_to_rules)</FONT></DIV>
<DIV><FONT face=Calibri></FONT>&nbsp;</DIV>
<DIV><FONT face=Calibri>where path_to_rules is&nbsp;a&nbsp;previously 
created&nbsp;(temp) file containg the&nbsp;reclassifiying rules as for 
example:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>1:1:1.1:1.1</FONT></DIV>
<DIV><FONT size=2 face=Arial>2:2:7.5:7.5</FONT></DIV>
<DIV><FONT size=2 face=Arial>3:3:0.4:0.4</FONT></DIV>
<DIV><FONT face=Calibri></FONT>&nbsp;</DIV>
<DIV><FONT face=Calibri>Christian.</DIV>
<DIV><BR></DIV></FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=luisapena1979@gmail.com 
href="mailto:luisapena1979@gmail.com">Luisa Peña</A> </DIV>
<DIV><B>Sent:</B> Tuesday, September 07, 2010 12:37 PM</DIV>
<DIV><B>To:</B> <A 
title="mailto:grass-user@lists.osgeo.org&#10;STRG + Klicken, um Verknüpfung zu folgen" 
href="mailto:grass-user@lists.osgeo.org">GRASS user list</A> </DIV>
<DIV><B>Subject:</B> [GRASS-user] Python Script for changing raster 
values</DIV></DIV></DIV>
<DIV><BR></DIV>Greetings 
<DIV><BR></DIV>
<DIV>I have a classification raster (with values that ranges from 1-20) and I 
need to reclassify them. I mean, to change (as an example):</DIV>
<DIV>1- &gt; 255</DIV>
<DIV>2- &gt; 100</DIV>
<DIV>3 -&gt; 150</DIV>
<DIV><BR></DIV>
<DIV>and I need to implement this on a Python script. What do you suggest to do? 
I mean, that is the most robust and easy way to implement this?</DIV>
<DIV>Thanks</DIV>
<DIV>Luisa</DIV>
<P>
<HR>

<P></P>_______________________________________________<BR>grass-user mailing 
list<BR>grass-user@lists.osgeo.org<BR>http://lists.osgeo.org/mailman/listinfo/grass-user<BR></BODY></HTML>