<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br>Am 23.03.2011 um 05:29 schrieb Glynn Clements:<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">Johannes Radinger wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">I try to rescale a rastermap with category values ranging from 1 to 16.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I want to rescale them by dividing the values by the maximum value, like<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">1 --&gt; 1/16, 10--&gt;10/16 and 16 --&gt; 1). I tried to do that with the r.rescale tool with setting the output range to 0,1 like:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">r.rescale input=input output=output to=0.0,1.0<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">but it I don't get float values as a results, only 0 and 1 as<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">integers. Does r.rescale handle floats<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">No. r.rescale is a front-end to r.reclass, which only handles<br></blockquote><blockquote type="cite">integers.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">r.recode provides similar functionality to r.reclass for<br></blockquote><blockquote type="cite">floating-point data (but it creates an entirely new map; reclass maps<br></blockquote><blockquote type="cite">only support integer data).<br></blockquote><blockquote type="cite"><br></blockquote>I looked at it but with r.code, I've to provide the input data range values as<br>fixed values (at least one) rather then saying use all values from min to max<br>as it is possible in rescale...<br><br><br><blockquote type="cite"><blockquote type="cite">Or is there any other simple way to divide the single raster values<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">by the maximum value and get a float value as result?<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><span class="Apple-tab-span" style="white-space: pre; ">        </span>r.mapcalc "output = input / 16.0"<br></blockquote><br>I think r.mapcalc is probably the best solution, but as I don't know the maximum<br>value in every case (I've to process several maps), I wanted to automatize.<br>Probably I've to write a script to read the max value and parse it to the mapcalc function.<br>My problem: First, I don't know how to do that, Second there is this python-script issue<br>on my mac (see other thread)...<br><br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">--&nbsp;<br></blockquote><blockquote type="cite">Glynn Clements &lt;<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>&gt;<br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">grass-user mailing list<br></blockquote><blockquote type="cite"><a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br></blockquote><blockquote type="cite"><a href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br></blockquote><div><br></div></body></html>