[GRASS-dev] r.mapcal and python

Roberto Antolí­n rantolin.geo at gmail.com
Mon Nov 10 09:36:41 EST 2008


Hi all,
I'm a python newbie so have some patience :-)

I'm trying to use r.mapcal with the grass.py function 'run_command' in 
this way:

e = "%s=%s-%s" % (out, dsm, dtm)
grass.run_command('r.mapcalc', expression = e)

However, the new raster in "%out" doesn't appear, and a new raster 
called 'expression' is created instead.

I also tried with:

grass.run_command('r.mapcalc', expression = "%s=%s-%s" % (out, dsm, dtm))

with the same result. And also with:

grass.run_command('r.mapcalc', %s = "%s-%s" % (out, dsm, dtm))

which threw at me an execution error.

Any suggestion?

Thanks in advanced,
Roberto.



More information about the grass-dev mailing list