[GRASS-SVN] r54890 - grass/trunk/lib/python/temporal

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Feb 4 01:08:16 PST 2013


Author: huhabla
Date: 2013-02-04 01:08:16 -0800 (Mon, 04 Feb 2013)
New Revision: 54890

Modified:
   grass/trunk/lib/python/temporal/mapcalc.py
Log:
Fixed base name is identical to output strds bug


Modified: grass/trunk/lib/python/temporal/mapcalc.py
===================================================================
--- grass/trunk/lib/python/temporal/mapcalc.py	2013-02-04 08:27:49 UTC (rev 54889)
+++ grass/trunk/lib/python/temporal/mapcalc.py	2013-02-04 09:08:16 UTC (rev 54890)
@@ -239,9 +239,8 @@
 
             # Create the r.mapcalc statement for the current time step
             map_name = "%s_%i" % (base, count)
-            expr = "%s=%s" % (map_name, expression)
             # Remove spaces and new lines
-            expr = expr.replace(" ", "")
+            expr = expression.replace(" ", "")
             
             # Check that all maps are in the sample
             valid_maps = True
@@ -284,7 +283,9 @@
                 new_map.set_relative_time(start, end, unit)
             
             # Parse the temporal expressions
-            expr = _operator_parser(expr,  sample_map_list[0],  sample_map_list[i])
+            expr = _operator_parser(expr, sample_map_list[0], sample_map_list[i])
+            # Add the output map name
+            expr = "%s=%s" % (map_name, expr)
 
             map_list.append(new_map)
 



More information about the grass-commit mailing list