[GRASS-SVN] r30162 - grass/trunk/scripts/v.rast.stats
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Feb 14 21:32:56 EST 2008
Author: hamish
Date: 2008-02-14 21:32:56 -0500 (Thu, 14 Feb 2008)
New Revision: 30162
Modified:
grass/trunk/scripts/v.rast.stats/v.rast.stats
Log:
check that unqualified name doesn't refer to a vector of the same name in another mapset
Modified: grass/trunk/scripts/v.rast.stats/v.rast.stats
===================================================================
--- grass/trunk/scripts/v.rast.stats/v.rast.stats 2008-02-14 21:30:57 UTC (rev 30161)
+++ grass/trunk/scripts/v.rast.stats/v.rast.stats 2008-02-15 02:32:56 UTC (rev 30162)
@@ -131,14 +131,17 @@
# does map exist in CURRENT mapset?
eval `g.findfile element=vector file="$GIS_OPT_VECTOR" mapset="$MAPSET"`
-if [ ! "$file" ] ; then
+VECT_MAPSET=`echo "$GIS_OPT_VECTOR" | grep '@' | cut -f2 -d'@'`
+if [ -z "$VECT_MAPSET" ] ; then
+ VECT_MAPSET="$MAPSET"
+fi
+if [ ! "$file" ] || [ "$VECT_MAPSET" != "$MAPSET" ] ; then
g.message -e "Vector map <$GIS_OPT_VECTOR> not found in current mapset"
exit 1
else
VECTOR=`echo "$GIS_OPT_VECTOR" | cut -f1 -d'@'`
fi
-
#check the input raster map
eval `g.findfile element=cell file="$RASTER"`
if [ ! "$file" ] ; then
More information about the grass-commit
mailing list