[GRASS-SVN] r56321 - grass-addons/grass6/raster/r.niche.similarity

svn_grass at osgeo.org svn_grass at osgeo.org
Mon May 20 02:45:22 PDT 2013


Author: pvanbosgeo
Date: 2013-05-20 02:45:21 -0700 (Mon, 20 May 2013)
New Revision: 56321

Modified:
   grass-addons/grass6/raster/r.niche.similarity/r.niche.similarity
Log:
bugfix

Modified: grass-addons/grass6/raster/r.niche.similarity/r.niche.similarity
===================================================================
--- grass-addons/grass6/raster/r.niche.similarity/r.niche.similarity	2013-05-20 06:54:59 UTC (rev 56320)
+++ grass-addons/grass6/raster/r.niche.similarity/r.niche.similarity	2013-05-20 09:45:21 UTC (rev 56321)
@@ -190,7 +190,7 @@
 
                if [ $GIS_FLAG_D -eq 1 ] ; then
                    TMPFILE1=rnicheOVERLAP$$_$$
-                   r.mapcalc "$TMPFILE1 = abs($MAP1/$SUM1 - $MAP2/$SUM2)"
+                   r.mapcalc "$TMPFILE1 = abs(double($MAP1)/$SUM1 - double($MAP2)/$SUM2)"
                    NO=`r.univar -g map=$TMPFILE1 | awk -F\= '$1=="sum" { print $2 }'`
                    NOV=$(echo "1 - 0.5 * $NO" | bc)
                    g.remove --q rast=$TMPFILE1
@@ -209,7 +209,7 @@
                
                if [ $GIS_FLAG_I -eq 1 ] ; then
                    TMPFILE2=rnicheEQUIV$$_$$
-                   r.mapcalc "$TMPFILE2 = (sqrt($MAP1/$SUM1) - sqrt($MAP2/$SUM2))^2"
+                   r.mapcalc "$TMPFILE2 = (sqrt(double($MAP1)/$SUM1) - sqrt(double($MAP2)/$SUM2))^2"
                    NE=`r.univar -g map=$TMPFILE2 | awk -F\= '$1=="sum" { print $2 }'`
                    NEQ=$(echo "1 - (0.5 * $NE)" | bc)
                    g.remove --q rast=$TMPFILE2



More information about the grass-commit mailing list