[GRASS-user] Retrieve list of values in Python

Martin Landa landa.martin at gmail.com
Tue Mar 29 18:57:11 EDT 2011


Hi,

2011/3/30 Christian Schwartze <christian.schwartze at uni-jena.de>:
> In order to get a list, here is just one approach:
> vals = os.popen(“r.stats –Nn your_map”).readlines()

use GRASS Scripting Library [1]

grass.read_command('r.stats', flags='Nn',input = 'map').splitlines()

Martin

[1] http://grass.osgeo.org/programming7/pythonlib.html

-- 
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa


More information about the grass-user mailing list