[Qgis-developer] Please tell me ho has coded qgsgrass.cpp !

Nicolas B. piklas at gmail.com
Wed Mar 19 09:50:46 EDT 2008


Hi list !

I'd like to know who has coded the grass support for QGIS. Are you here ?
Does anybody know ?
My goal is to contact them to get more information about the way
qgsgrass.cpp, qgsgrassmodule.cpp, qgsgrassshell.cpp ....
In fact i'm trying to parse this C++ code into python from quite a long time
ago, in the aim to be abble to call grasstools from any external QGIS python
plugin.
I understands i have to use Qprocess like in the C++, and also to set up the
grass environment / variables in my python code.

I've tested several methods to to the job, but it still fails.

For example, i'm trying to call r.stats command from the rxvt shell with the
following code:
( i want to get the raster cells values written in a txt file)
******************************************************************************************************
    process = QProcess()
    exe =QString("rxvt.exe")
    arg=QStringList("r.stats -1gn input=mnt10m output='C:/test' fs=;");
    arg.append("@ARGS_PARSED@")
    env = process.systemEnvironment()
    env.append("$GISDBASE='D:/DATA';")
    env.append("$LOCATION_NAME='neff';")
    env.append("$MAPSET='neffmap';")
    process.setEnvironment(env)
    process.start(exe,arg)

********************************************************************************************************
This code snippet doesn't work (the txt file isn't created) but i got no
python errors and no QGIS crash so i think i'm just missing something
important
That's why i'd really enjoy being in contact with Qgrass developers, to know
what's going wrong
Or may be someone with good knowledge of the QGIS API and Python knows how
to do the trick ???

Any hints, help or advices would be really appreciated
Thanks

PikO
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20080319/82c97e65/attachment.html


More information about the Qgis-developer mailing list