[GRASS-user] How to get a list of maps from a group in python script

Leonardo Hardtke leohardtke at gmail.com
Tue Apr 5 17:52:18 PDT 2016


Dear list members,
I know this is more a python question than a GRASS question, bot for sure
some of you knows the ansewer and is able to help me....

I need to get a python list with the maps from a group, like
["map1","map2","map"]

But by using gscript.read_command.... i get string, not a list.

gscript.read_command("i.group", group=groupname, flags="l" )
'group <LE72270902002150EDC00_toar> references the following raster
maps\n-------------\n<LE72270902002150EDC00_toar.1 at landsat>
 \n<LE72270902002150EDC00_toar.2 at landsat>
 \n<LE72270902002150EDC00_toar.3 at landsat>
 \n<LE72270902002150EDC00_toar.4 at landsat>
 \n<LE72270902002150EDC00_toar.5 at landsat>
 \n<LE72270902002150EDC00_toar.7 at landsat>    \n-------------\n'

Your help is appreciated!
Leo
-- 
Dr. Leonardo A. Hardtke
Laboratorio de Teledetección y S.I.G.
Centro Nacional Patagónico (CONICET)
Bvd. Brown 2825, 9120
Puerto Madryn, Chubut, Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20160406/fd93b679/attachment.html>


More information about the grass-user mailing list