[GRASS-user] r.mapcalc and us of max value

Simon Georget simon.georget at gmail.com
Fri Apr 26 04:52:02 PDT 2013


On Thu, Apr 25, 2013 at 10:26 PM, Markus Metz <markus.metz.giswork at gmail.com
> wrote:

> r.info reports max of the raster map as it is, r.univar reports max
> for the current region settings. Since r.mapcalc uses the current
> region settings, you should really use r.univar instead of r.info.


Thanks for the precision. My current region is set using the raster map.


On Fri, Apr 26, 2013 at 10:29 AM, Markus Neteler <neteler at osgeo.org> wrote:

>
>
> GRASS 6.4.3svn (nc_spm_08):~ > eval `r.univar -g elevation`
> GRASS 6.4.3svn (nc_spm_08):~ > echo $max
> 156.329864501953
> GRASS 6.4.3svn (nc_spm_08):~ > r.mapcalc "newrast = myrast * 100.0 / $max"
>
> Note that I wrote 100.0 for floating point arithmetics.
>
> If you really want r.info, then likewise with:
>
> GRASS 6.4.3svn (nc_spm_08):~ > eval `r.info -gr elevation`
>
> markusN
>

Nice alternative, indeed.

Thanks to all of you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130426/ae9f4338/attachment-0001.html>


More information about the grass-user mailing list