[GRASS-dev] possible bug on r.mapcalc round() G7
Markus Metz
markus.metz.giswork at gmail.com
Fri Mar 15 12:57:27 PDT 2013
On Fri, Mar 15, 2013 at 8:38 PM, Margherita Di Leo
<dileomargherita at gmail.com> wrote:
> Hi all,
>
> trying to rescale a map to 0:255 range, I run:
>
> r.univar -g map
> n=9599576
> null_cells=0
> cells=9599576
> min=-1.55537462234497
> max=274.231811523438
> range=275.787186145782
> mean=96.915776629461
> mean_of_abs=96.915791505254
> stddev=37.6540983935747
> variance=1417.831125833
> coeff_var=38.8523929778099
> sum=930350363.3535346985
>
> taking the max, i run:
>
> r.mapcalc "map.invscaled = round((1.0 - map / 274.231811523438) * 255.0)"
try
r.mapcalc "map.invscaled = round((1.0 - ((map - $min) / $range)) * 255.0)"
Markus M
More information about the grass-dev
mailing list