[GRASS-SVN] r69787 - grass/trunk/scripts/r.fillnulls
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Nov 7 08:36:34 PST 2016
Author: marisn
Date: 2016-11-07 08:36:34 -0800 (Mon, 07 Nov 2016)
New Revision: 69787
Modified:
grass/trunk/scripts/r.fillnulls/r.fillnulls.py
Log:
Quote map names in mapcalc to prevent failures if input/output name is also a valid mapcalc expression
Modified: grass/trunk/scripts/r.fillnulls/r.fillnulls.py
===================================================================
--- grass/trunk/scripts/r.fillnulls/r.fillnulls.py 2016-11-07 15:43:05 UTC (rev 69786)
+++ grass/trunk/scripts/r.fillnulls/r.fillnulls.py 2016-11-07 16:36:34 UTC (rev 69787)
@@ -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