[GRASS-SVN] r46371 - grass/branches/releasebranch_6_4/scripts/r.mask

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 22 11:08:20 EDT 2011


Author: neteler
Date: 2011-05-22 08:08:20 -0700 (Sun, 22 May 2011)
New Revision: 46371

Modified:
   grass/branches/releasebranch_6_4/scripts/r.mask/r.mask
Log:
catch user error

Modified: grass/branches/releasebranch_6_4/scripts/r.mask/r.mask
===================================================================
--- grass/branches/releasebranch_6_4/scripts/r.mask/r.mask	2011-05-22 14:51:30 UTC (rev 46370)
+++ grass/branches/releasebranch_6_4/scripts/r.mask/r.mask	2011-05-22 15:08:20 UTC (rev 46371)
@@ -92,6 +92,13 @@
    fi
 fi
 
+if [ -n "$GIS_OPT_MASKCATS" -a "$GIS_FLAG_R" -eq 0 ]; then
+   eval `r.info -t $GIS_OPT_INPUT`
+   if [ "$datatype" != "CELL" ] ; then
+      g.message -e "Raster map <$GIS_OPT_INPUT> must be integer for maskcats parameter"
+      exit 1
+   fi
+fi
 
 if [ "$GIS_FLAG_R" -eq 1 ]; then
 	if test -f "`g.gisenv GISDBASE`/`g.gisenv LOCATION_NAME`/`g.gisenv MAPSET`/cell/MASK" ; then



More information about the grass-commit mailing list