Personal tools
You are here: Home LINC Projects ITI-Geospatial Data Analysis GRASS GIS Batch Processing With Grass63

Batch Processing With Grass63

How to do batch processing with Grass 6.3

Note, the information here was obtained from http://grass.osgeo.org/wiki/GRASS_and_Shell

Create a file with only grass valid commands.  In this example, I'll call it myprocess.sh

Next, set the permissions on the file to be executable:

chmod u+x myprocess.sh

Now, we need to set the environment variable GRASS_BATCH_JOB

to point to this file.

For bash, this would be done via this way:

export GRASS_BATCH_JOB=`pwd`/myprocess.sh

and for CSH, it would be

setenv GRASS_BATCH_JOB `pwd`/myprocess.sh

Next, you will need to know the location of the both the Project and MAPSET you want to work with.  So, say the Project is stmartin and the mapset is PERMANENT.  The Project is stored in directory /joy/grassdata.  Then, the full path to the mapset is /joy/grassdata/stmartin/PERMANENT

.

So, to run the batch command, you need to type this:

grass63 /joy/grassdata/stmartin/PERMANENT

GRASS is invoked.  If there are no errors, it runs through all the commands and then exits.

Afterwards, you need to unset the GRASS_BACTH_JOB variable - otherwise, anytime you type grass63, it will try to run grass in batch mode.

To unset in BASH, type

unset GRASS_BATCH_JOB

In CVS, type

unsetenv GRASS_BATCH_JOB

 

Document Actions
« May 2012 »
May
MoTuWeThFrSaSu
123456
78910111213
14151617181920
21222324252627
28293031