[GRASS-user] grass.script.raster.mapcalc and multiple computations

Panagiotis Mavrogiorgos pmav99 at gmail.com
Fri Oct 30 05:14:11 PDT 2015


Hi everyone,

Is it possible to perform multiple computations using
grass.script.raster.mapcalc()? What I want is to run something like this
(example taken from r.mapcalc documentation):

r.mapcalc <<EOF
> $GIS_OPT_OUTPUT.r = r#$GIS_OPT_FIRST * .$GIS_OPT_PERCENT + (1.0 -
> .$GIS_OPT_PERCENT) * r#$GIS_OPT_SECOND
> $GIS_OPT_OUTPUT.g = g#$GIS_OPT_FIRST * .$GIS_OPT_PERCENT + (1.0 -
> .$GIS_OPT_PERCENT) * g#$GIS_OPT_SECOND
> $GIS_OPT_OUTPUT.b = b#$GIS_OPT_FIRST * .$GIS_OPT_PERCENT + (1.0 -
> .$GIS_OPT_PERCENT) * b#$GIS_OPT_SECOND
> EOF


When I give an expression as a multiline string, I get an error like this
one:

Invalid map <i>
> Parse error
> ERROR: parse error
> ERROR: An error occurred while running r.mapcalc


with kind regards,
Panos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20151030/4b89829c/attachment.html>


More information about the grass-user mailing list