[GRASS-user] listing raster maps as input for "i.group"

umbertofilippo umbertofilippo at tiscali.it
Tue Nov 4 06:38:58 PST 2014


How do I use the output of "g.mlist" as input for another function in 
GRASS 6.4.4 and Python console?
Here is my specific case: I have to group the list of raster maps that 
begin with "globrad" using "i.group".
Anyway, my code seems not working, as "i.group" returns an empty dict ( 
i.e "{ }").
Here is my code, any suggestion would be very appreciated:

     map_list = grass.read_command("g.mlist", type="rast", 
pattern="globrad*",separator=",")
     group = grass.run_command("i.group", group = "glob_rad", subgroup = 
"glob_rad", input = map_list)

The first line returns

     globrad1,globrad2

which is "string" type, the second line returns { } (empty dictionary).

Thanks in advance!
     umberto


More information about the grass-user mailing list