[GRASS-dev] r.mapcalc bug on max and min?

Moritz Lennert mlennert at club.worldonline.be
Mon Oct 6 06:15:57 PDT 2014


On 06/10/14 15:07, Pietro wrote:
> On Mon, Oct 6, 2014 at 2:25 PM, Anna Petrášová <kratochanna at gmail.com> wrote:
>> On Mon, Oct 6, 2014 at 4:51 AM, Pietro <peter.zamb at gmail.com> wrote:
>>> Again everything is NULL, I'm doing something wrong or it is a bug?
>>
>>
>> Glynn could perhaps give you some more precise comment, but basically, max
>> doesn't operate on the entire map but only on the current cell. So for
>> example, r.macalc "map_max = max(elevation1, elevation2, elevation3)"
>> creates a map where each cell is the largest value of the corresponding
>> cells in the 3 elevation maps.
>
> Ahh, I misunderstood the documentation I thought it was not pixel by
> pixel but for the whole raster map...
> now the results are explained! :-)
>
> Perhaps we could add two new functions, like: rmin and rmax that stay
> for range min and range max that give this information, do you think
> could be useful?

You can use either r.info (entire map) or r.univar (current region) for 
that and then reuse the info in r.mapcalc.

Moritz


More information about the grass-dev mailing list