Hi,<br><br>How do I set $LOCATION_NAME and $MAPSET, I've tried but still saying LOCATION_NAME and MAPSET not set?<br><br><div class="gmail_quote">On Mon, Jun 28, 2010 at 11:51 AM, Paul Kelly <span dir="ltr"><<a href="mailto:paul-grass@stjohnspoint.co.uk">paul-grass@stjohnspoint.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">Sandile Gumede wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi<br>
<br>
I'm trying to run the script below but it's giving me an error saying default region is not set.<br>
<br>
Which command should I use to set the default region and do I put it?<br>
<br>
#!/bin/sh<br>
<br>
#variable to customize:<br>
# path to GRASS software main directory<br>
GISDBASE=/home/tgumede1/grassdata<br> LOCATION_NAME=Floods<br> MAPSET=PERMANENT<br> GISBASE=/usr/lib/grass64<br></blockquote></div></div></blockquote><div><br>GSIDBASE= 'g.gisenv GISDBASE'<br>LOCATION_NAME='g.gisenv LOCATION_NAME'<br>
MAPSET='g.gisenv MAPSET'<br><br>LOCATION="${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}" <br></div><div> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div class="h5"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
# nothing to change below<br>
MAP=$1<br>
LOCATION=$2<br>
<br>
<br>
# generate temporal LOCATION:<br>
TEMPDIR=FLOODS<br>
mkdir -p $GISDBASE/$TEMPDIR/PERMANENT<br>
<br>
# save existing $HOME/.grassrc6<br>
if test -e $HOME/.grassrc6 ; then<br>
mv $HOME/.grassrc6 /tmp/$TEMPDIR.grassrc6<br>
fi<br>
<br>
echo "LOCATION_NAME: $TEMPDIR" > $HOME/.grassrc6<br>
echo "MAPSET:PERMANENT" >> $HOME/.grassrc6<br>
echo "DIGITIZER: none" >> $HOME/.grassrc6<br>
echo "GISDBASE: $GISDBASE" >> $HOME/.grassrc6<br>
export GISBASE=$GISBASE<br>
<br>
# Create a WIND file with minimal information and no projection:<br>
echo "proj: 0<br>
zone: 0<br>
north: 1<br>
south: 0<br>
east: 1<br>
west: 0<br>
cols: 1<br>
rows: 1<br>
e-w resol: 1<br>
n-s resol: 1<br>
top: 1<br>
bottom: 0<br>
cols3: 1<br>
rows3: 1<br>
depths: 1<br>
e-w resol3: 1<br>
n-s resol3: 1<br>
t-b resol: 1<br>
" > $TEMPDIR/$LOCATION_NAME/$MAPSET/WIND<br>
# Copy WIND-file to DEFAULT_WIND:<br>
cp $TEMPDIR/$LOCATION_NAME/$MAPSET/WIND \<br>
$TEMPDIR/$LOCATION_NAME/$MAPSET/DEFAULT_WIND<br>
</blockquote>
<br>
<br></div></div>
Where are the variables $LOCATION_NAME and $MAPSET being set? As far as I can see they seem to be empty - could that be the problem?<br><font color="#888888">
<br>
Paul<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Kind Regards<br>TS Gumede<br>CSIR, Meraka Institute<br>072 258 1650<br><br>