<p dir="ltr"><br>
Il 06/ott/2014 17:04 "Moritz Lennert" <<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</a>> ha scritto:<br>
><br>
> On 06/10/14 16:14, Pietro wrote:<br>
>><br>
>> On Mon, Oct 6, 2014 at 3:17 PM, Moritz Lennert<br>
>> <<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</a>> wrote:<br>
>>><br>
>>> On 06/10/14 14:54, Pietro wrote:<br>
>>>><br>
>>>><br>
>>>> Trying to circumvent the r.mapcalc min/max limit,<br>
>>><br>
>>><br>
>>><br>
>>> Just out of curiosity: why don't you just use r.recode or r.rescale ?<br>
>><br>
>><br>
>> r.rescale was my first option, but it just reclassify in two<br>
>> categories 1 and 255.<br>
><br>
><br>
> r.rescale assumes that input is integer, so if you feed it values between 0 and 1 then yes, but using the NC data as example and feeding it the elevation data directly:<br>
><br>
> r.rescale elevation out=elevation_0_255 to=0,255<br>
><br>
> gives the expected result.</p>
<p dir="ltr">To make the example reproducible I've scaled the elevation map to have all the values between 0 and 1.</p>
<p dir="ltr">So as you said r.rescale is not an option.<br></p>
<p dir="ltr">>> I didn't thought about r.recode...but I think that easier combining <a href="http://r.info">r.info</a>.<br>
><br>
> Why would you need <a href="http://r.info">r.info</a> for that ?<br></p>
<p dir="ltr">Sorry I was in harry to catch the train... I was too succinct... I mean as you suggested combine r.mapcalc and <a href="http://r.info">r.info</a> to rescale...</p>
<p dir="ltr">Another option is to modify r.rescale to work with CELL,FCELL, and DCELL.<br>
I don't see any particular reason to limit the module to the cell case...</p>
<p dir="ltr">> Dividing by the max and then rescaling should give the same<br>
> result as rescaling from the original values... All you are<br>
> doing is dividing all values by a constant before rescaling.</p>
<p dir="ltr">Yes, this was just an example using the north Carolina data set to make the problem reproducible...</p>
<p dir="ltr">But it is true I can also multiply my map to 10000 and then use r.rescale. I think should work.<br></p>