[GRASS-dev] [GRASS GIS] #2659: replace function bug in t.rast.mapcalc.py

GRASS GIS trac at osgeo.org
Mon Apr 20 03:50:59 PDT 2015


#2659: replace function bug in t.rast.mapcalc.py
----------------------------+-----------------------------------------------
 Reporter:  eosduero        |       Owner:  grass-dev@…              
     Type:  defect          |      Status:  new                      
 Priority:  normal          |   Milestone:  7.0.1                    
Component:  Python          |     Version:  7.0.0                    
 Keywords:  t.rast.mapcalc  |    Platform:  Unspecified              
      Cpu:  x86-32          |  
----------------------------+-----------------------------------------------

Comment(by eosduero):

 A possible solution:


 {{{
             # current time step
             for j in range(len(map_matrix)):
                 if map_matrix[j][i] is None:
                     valid_maps = False
                     break
                 # Substitute the dataset name with the map name
                 expr = expr.replace(id_list[j], "aux__%00002d__" % j)

             # EOS
             for j in range(len(map_matrix)):
                 if map_matrix[j][i] is None:
                     valid_maps = False
                     break
                 # Substitute the dataset name with the map name
                 expr = expr.replace("aux__%00002d__" % j,
 map_matrix[j][i])
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2659#comment:2>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list