Hi all, Moritz,

Moritz Lennert escribió:
grass.run_command('r.mapcalc', expression = "%s=%s-%s" % (out, dsm, dtm))

The expression= parameter only exists in GRASS7, but not in grass6.x.

So, r.mapcalc expression=k=1

will give you

in GRASS6.x: a map called 'expression' with the value 1

That was exactly what I obtained: a map called 'expression' with the difference between dtm and dsm.

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

No expert, but shouldn't this be:

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

In fact that was the first thing I tried, but I got this error:

syntax error, unexpected '-', expecting NAME or STRING
Parse error

Regards,
Roberto.
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to