[GRASS-dev] casting row buffer in memory
Moritz Lennert
mlennert at club.worldonline.be
Mon Oct 6 07:57:33 PDT 2014
On 06/10/14 16:14, Pietro wrote:
> On Mon, Oct 6, 2014 at 3:17 PM, Moritz Lennert
> <mlennert at club.worldonline.be> wrote:
>> On 06/10/14 14:54, Pietro wrote:
>>>
>>> Trying to circumvent the r.mapcalc min/max limit,
>>
>>
>> Just out of curiosity: why don't you just use r.recode or r.rescale ?
>
> r.rescale was my first option, but it just reclassify in two
> categories 1 and 255.
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:
r.rescale elevation out=elevation_0_255 to=0,255
gives the expected result.
>
> I didn't thought about r.recode...but I think that easier combining r.info.
Why would you need r.info for that ?
Dividing by the max and then rescaling should give the same result as
rescaling from the original values... All you are doing is dividing all
values by a constant before rescaling.
Moritz
More information about the grass-dev
mailing list