[GRASS-SVN] r69835 - grass/branches/releasebranch_7_2/scripts/r.fillnulls

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Nov 16 02:13:12 PST 2016


Author: neteler
Date: 2016-11-16 02:13:12 -0800 (Wed, 16 Nov 2016)
New Revision: 69835

Modified:
   grass/branches/releasebranch_7_2/scripts/r.fillnulls/r.fillnulls.py
Log:
r.fillnulls: Quote map names in mapcalc to prevent failures if input/output name is also a valid mapcalc expression (trunk, r69787)

Modified: grass/branches/releasebranch_7_2/scripts/r.fillnulls/r.fillnulls.py
===================================================================
--- grass/branches/releasebranch_7_2/scripts/r.fillnulls/r.fillnulls.py	2016-11-16 07:49:55 UTC (rev 69834)
+++ grass/branches/releasebranch_7_2/scripts/r.fillnulls/r.fillnulls.py	2016-11-16 10:13:12 UTC (rev 69835)
@@ -173,10 +173,10 @@
         # creating binary (0/1) map
         if usermask:
             grass.message(_("Skipping masked raster parts"))
-            grass.mapcalc("$tmp1 = if(isnull($input) && !($mask == 0 || isnull($mask)),1,null())",
+            grass.mapcalc("$tmp1 = if(isnull(\"$input\") && !($mask == 0 || isnull($mask)),1,null())",
                           tmp1=prefix + 'nulls', input=input, mask=usermask)
         else:
-            grass.mapcalc("$tmp1 = if(isnull($input),1,null())",
+            grass.mapcalc("$tmp1 = if(isnull(\"$input\"),1,null())",
                           tmp1=prefix + 'nulls', input=input)
         tmp_rmaps.append(prefix + 'nulls')
 
@@ -311,7 +311,7 @@
                               "user mask if needed:"))
 
             # no idea why r.grow old=-1 doesn't replace existing values with NULL
-            grass.mapcalc("$out = if($inp == -1, null(), $dem)",
+            grass.mapcalc("$out = if($inp == -1, null(), \"$dem\")",
                           out=holename + '_edges', inp=holename + '_grown', dem=input)
             tmp_rmaps.append(holename + '_edges')
 



More information about the grass-commit mailing list