[GRASS-user] scripts

Sandile Gumede akasandile at gmail.com
Thu Jun 17 08:34:45 EDT 2010


Hi

I'm not familiar with bash scripting, I want to write a script that starts
GRASS and create a new LOCATION and a MAPSET, specify the coordinate system
for my database, specify a geodetic datum for the LOCATION, import datasets
into the GRASS, do watershed analysis on the DEM data set, convert DEM
raster into vector, and then calculate univariate statistics from a GRASS
raster map.

Can you guys help me with this? I tried to write a script and I got stucked,
see below:

#!/bin/sh

#variable to customize:
# path to GRASS software main directory
GISBASE=/usr/bin/grass64
# path to GRASS database
GISDBASE=$HOME/grassdem

# nothing to change below
#MAP=PERMANENT
#LOCATION=SRTMDEM


# generate temporal LOCATION:
LOCATION=srtmdem
mkdir -p $GISDBASE/$LOCATION/PERMANENT

# save existing $HOME/.grassrc6
if test -e $HOME/.grassrc6 ; then
mv $HOME/.grassrc6 /$HOME/grassdem/$LOCATION.grassrc6
fi

echo "LOCATION_NAME: $LOCATION" > $HOME/.grassrc6
echo "MAPSET:tmp" >> $HOME/.grassrc6
echo "DIGITIZER: none" >> $HOME/.grassrc6
echo "GISDBASE: $GISDBASE" >> $HOME/.grassrc6
export GISBASE=$GISBASE





-- 
Kind Regards
TS Gumede
CSIR, Meraka Institute
072 258 1650
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20100617/6cfc1a2b/attachment.html


More information about the grass-user mailing list