[GRASS-SVN] r53633 - grass/branches/develbranch_6/scripts/r.blend

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Oct 31 23:37:29 PDT 2012


Author: neteler
Date: 2012-10-31 23:37:28 -0700 (Wed, 31 Oct 2012)
New Revision: 53633

Modified:
   grass/branches/develbranch_6/scripts/r.blend/r.blend
Log:
NULL handling is broken, see G6.4 or 7; fix awk

Modified: grass/branches/develbranch_6/scripts/r.blend/r.blend
===================================================================
--- grass/branches/develbranch_6/scripts/r.blend/r.blend	2012-11-01 06:33:00 UTC (rev 53632)
+++ grass/branches/develbranch_6/scripts/r.blend/r.blend	2012-11-01 06:37:28 UTC (rev 53633)
@@ -57,8 +57,13 @@
 if  [ -z "$GISBASE" ] ; then
    echo "You must be in GRASS GIS to run this program." 1>&2
    exit 1
-fi   
+fi
 
+# setting environment, so that awk works properly in all languages
+unset LC_ALL
+LC_NUMERIC=C
+export LC_NUMERIC
+
 # save command line
 if [ "$1" != "@ARGS_PARSED@" ] ; then
     CMDLINE=`basename "$0"`
@@ -87,6 +92,8 @@
 PERC_INV=`echo "$PERCENT" | awk '{printf("%.6g", 100.0 - $1)}'`
 
 g.message "Calculating the three component maps..."
+
+# TODO: NULL handling is broken, see G6.4 or 7
 r.mapcalc "$OUTPUT.r = r#$FIRST * $PERCENT/100.0 + (1.0 - $PERCENT/100.0) * r#$SECOND ; \
            $OUTPUT.g = g#$FIRST * $PERCENT/100.0 + (1.0 - $PERCENT/100.0) * g#$SECOND ; \
            $OUTPUT.b = b#$FIRST * $PERCENT/100.0 + (1.0 - $PERCENT/100.0) * b#$SECOND"



More information about the grass-commit mailing list