[GRASS-SVN] r29828 - grass/trunk/scripts/r.regression.line
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jan 25 05:33:02 EST 2008
Author: neteler
Date: 2008-01-25 05:33:02 -0500 (Fri, 25 Jan 2008)
New Revision: 29828
Modified:
grass/trunk/scripts/r.regression.line/r.regression.line
Log:
don't fail on empty map(s)
Modified: grass/trunk/scripts/r.regression.line/r.regression.line
===================================================================
--- grass/trunk/scripts/r.regression.line/r.regression.line 2008-01-25 10:32:16 UTC (rev 29827)
+++ grass/trunk/scripts/r.regression.line/r.regression.line 2008-01-25 10:33:02 UTC (rev 29828)
@@ -91,6 +91,11 @@
#calculate regression equation
r.stats -cnA input=$GIS_OPT_MAP1,$GIS_OPT_MAP2 > "$TMP"
+if [ ! -s "$TMP" ] ; then
+ g.message -e "One or both input maps only contain no data (NULL) pixels in the current region"
+ exit 1
+fi
+
awk '{tot += $3;sumX +=$1 * $3; sumsqX +=$1*$1*$3;sumY +=$2 * $3; sumsqY +=$2*$2*$3;\
sumXY +=$1*$2*$3;\
}\
More information about the grass-commit
mailing list