2009/5/4 Nikos Alexandris <nikos.alexand...@felis.uni-freiburg.de>:
> I need the number of rows and columns to use with v.mkgrid. Currently I
> use the following, rather long and complex command:
> g.region -g | grep o | cut -d"=" -f2 | tr "\n" "," | cut -d"," -f1,2

in Python

ret = grass.read_command('g.region', flags = 'g')
reg = grass.parse_key_val(ret)
print '%d,%d' % (int(reg['rows']), int(reg['cols']))

Martin

-- 
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to