[GRASS-user] GRASS Scripting questions

António Rocha antonio.rocha at deimos.com.pt
Thu Dec 17 06:35:37 EST 2009


Greetings all

I'm doing a few Script files for GRASS but I'm having a few difficulties 
in a few issues. My first question is about how to peform raster algebra 
using the ouput as an input. Example:
I'm trying to create a file which is the sum of a list of input files
Input is defined as:
#% key: input
#% type: string
#% required : yes
#% multiple : yes

And output is defined as
#% key: counter1
#% type: string
#% required : yes

itinialization of counter1
r.mapcalc $GIS_OPT_COUNTER1= "float (0)"

The cycle:
IFS=,
for opt in $GIS_OPT_INPUT; do
    r.mapcalc $GIS_OPT_SOMA= "$opt+$GIS_OPT_SOMA)"
done

And the command output is:
ERROR: Unable to close raster map
ERROR: Unable to close raster map
(for each $opt file, I get this error)
This means that I'm unable to use the output file as an input.  Do 
anyone has a suggestion of how to do this operation without getting this 
error?

Thanks for your help

Best regards,
Antonio Rocha



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4695 (20091217) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




More information about the grass-user mailing list