[GRASS-user] r.mapcalculator

Hello users,

I really could use some hints regarding this problem.

I want to generate a new raster from the following expression (using r.mapcalculator from QGIS GRASS plugin):

A0.5+B0.05+C0.2+D0.2+E*0.05

All rasters are integer16 geotiff anda have the same resolution. I just get this message:

r.mapcalculator amap=A@PERMANENT bmap=B@PERMANENT cmap=C@PERMANENT dmap=D@PERMANENT emap=E@PERMANENT = formula=A0.5+B0.05+C0.2+D0.2+E*0.05 outfile=Erosao

r.mapcalc “Erosao” = “( " “A@PERMANENT” @PERMANENT” *0.5+ " “B@PERMANENT” @PERMANENT" *0.05+ " “C@PERMANENT” @PERMANENT" *0.2+ " “D@PERMANENT” @PERMANENT" *0.2+ " “E@PERMANENT” @PERMANENT" *0.05)"

Illegal filename. Character not allowed.

Invalid map

Parse error

Calculating Erosao. Try expert mode.

Finished with error

I suspect something very basic is missing but I don´t know what could it be!!

Andre

Associação Leonel Trindade
SOCIEDADE DE HISTÓRIA NATURAL

Apartado 25 2564-909 Torres Vedras Portugal
Sede e Biblioteca: rua Cavaleiros da Espora Dourada, 27A 2560 Torres Vedras

Laboratório de Paleontologia e Paleoecologia: Polígono Industrial do Alto do Ameal 2565-641 Ramalhal
http://alt-shn.blogspot.com
www.alt-shn.org

Hello

Regarding your first question, (convert floating point raster to integer) you can use:
r.mapcalc "int_raster = int(fp_raster)

Hello users,

I really could use some hints regarding this problem.

I want to generate a new raster from the following expression (using r.mapcalculator from QGIS GRASS plugin):

A0.5+B0.05+C0.2+D0.2+E*0.05

All rasters are integer16 geotiff anda have the same resolution. I just get this message:

r.mapcalculator amap=A@PERMANENT bmap=B@PERMANENT cmap=C@PERMANENT dmap=D@PERMANENT emap=E@PERMANENT = formula=A0.5+B0.05+C0.2+D0.2+E*0.05 outfile=Erosao

Here, I think you want to skip the ‘@’ character.
BTW, you can just run the above straight within r.mapcalc also:
r.mapcalc “Erosao = A0.5 + B0.05 + C0.2 + D0.2 + E*0.05”

···
-- 
Micha Silver
[http://www.surfaces.co.il/](http://www.surfaces.co.il/)
Arava Development Co.  +972-52-3665918