[GRASS-SVN] r36832 -
grass/branches/releasebranch_6_4/scripts/r.shaded.relief
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Apr 21 01:49:49 EDT 2009
Author: hamish
Date: 2009-04-21 01:49:49 -0400 (Tue, 21 Apr 2009)
New Revision: 36832
Modified:
grass/branches/releasebranch_6_4/scripts/r.shaded.relief/r.shaded.relief
Log:
check for overwrite (merge from devbr6)
Modified: grass/branches/releasebranch_6_4/scripts/r.shaded.relief/r.shaded.relief
===================================================================
--- grass/branches/releasebranch_6_4/scripts/r.shaded.relief/r.shaded.relief 2009-04-21 05:48:49 UTC (rev 36831)
+++ grass/branches/releasebranch_6_4/scripts/r.shaded.relief/r.shaded.relief 2009-04-21 05:49:49 UTC (rev 36832)
@@ -129,11 +129,11 @@
LC_NUMERIC=C
export LC_NUMERIC
-alt=$GIS_OPT_ALTITUDE
-az=$GIS_OPT_AZIMUTH
-elev=$GIS_OPT_MAP
-zmult=$GIS_OPT_ZMULT
-scale=$GIS_OPT_SCALE
+alt="$GIS_OPT_ALTITUDE"
+az="$GIS_OPT_AZIMUTH"
+elev="$GIS_OPT_MAP"
+zmult="$GIS_OPT_ZMULT"
+scale="$GIS_OPT_SCALE"
eval `g.findfile element=cell file=$elev`
if [ -z "$name" ] ; then
@@ -152,6 +152,16 @@
ELEVSHADE="$GIS_OPT_SHADEDMAP"
fi
+# test for overwrite as r.mapcalc doesn't
+eval `g.findfile element=cell file="$ELEVSHADE" mapset=.`
+if [ -n "$name" ] ; then
+ # map already exists
+ if [ -z "$GRASS_OVERWRITE" ] || [ "$GRASS_OVERWRITE" -ne 1 ] ; then
+ g.message -e "option <shadedmap>: <$ELEVSHADE> exists."
+ exit 1
+ fi
+fi
+
# allow - and . chars in the map name
elev="\"$elev\""
elev_out="\"$ELEVSHADE\""
More information about the grass-commit
mailing list