[Qgis-developer] launch r.stats with python ?!
Nicolas B.
piklas at gmail.com
Tue Feb 5 05:52:34 EST 2008
Hi list
I'm trying to call r.stats grasstools from a python plugin
( doing a r.stats -1gn automatically in fact)
this python code is based on qgsgrassmodule.cpp, wich is used to launch
grasstools in QGIS.
I get the grass environment by opening a mapset manually before running the
python code.
Then i'm using a QProcess and appending the flag and options.
Got NO ERRORS in python console, but the output file isn't created.
May be there's a problem with args in the last line ??
Is there a python developer in the place ?
--------------------------------------------------------------------------------------------------
arg=['C:\Program Files\Quantum GIS\grass\bin\r.stats.exe'];
process = QProcess()
env = process.systemEnvironment()
env.append("GIS_FLAG_1=1")
env.append("GIS_FLAG_G=1")
env.append("GIS_FLAG_N=1")
env.append("GIS_OPT_INPUT=input=mnt10m")
env.append("GIS_OPT_OUTPUT=output=C:\testxyz")
env.append("GIS_OPT_FS=fs=;")
arg.append("@ARGS_PARSED@")
process.setEnvironment(env)
process.start(arg[0],arg)
--------------------------------------------------------------------------------------------------
Any Ideas ?
Thanks 4 any hints
PikOBoZ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20080205/4b6a1c36/attachment.html
More information about the Qgis-developer
mailing list