Hi list !<br><br>I&#39;d like to know who has coded the grass support for QGIS. Are you here ? Does anybody know ?<br>My goal is to contact them to get more information about the way qgsgrass.cpp, qgsgrassmodule.cpp, qgsgrassshell.cpp ....<br>
In fact i&#39;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.<br>I understands i have to use Qprocess like in the C++, and also to set up the grass environment / variables in my python code.<br>
<br>I&#39;ve tested several methods to to the job, but it still fails.<br><br>For example, i&#39;m trying to call r.stats command from the rxvt shell with the following code:<br>( i want to get the raster cells values written in a txt file)<br>
******************************************************************************************************<br>&nbsp;&nbsp;&nbsp; <span style="font-style: italic;">process = QProcess()</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; exe =QString(&quot;rxvt.exe&quot;)</span><br style="font-style: italic;">
<span style="font-style: italic;">&nbsp;&nbsp;&nbsp; arg=QStringList(&quot;r.stats -1gn input=mnt10m output=&#39;C:/test&#39; fs=;&quot;);</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; arg.append(&quot;@ARGS_PARSED@&quot;)</span><br style="font-style: italic;">
<span style="font-style: italic;">&nbsp;&nbsp;&nbsp; env = process.systemEnvironment()</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; env.append(&quot;$GISDBASE=&#39;D:/DATA&#39;;&quot;)</span><br style="font-style: italic;">
<span style="font-style: italic;">&nbsp;&nbsp;&nbsp; env.append(&quot;$LOCATION_NAME=&#39;neff&#39;;&quot;)</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; env.append(&quot;$MAPSET=&#39;neffmap&#39;;&quot;)</span><br style="font-style: italic;">
<span style="font-style: italic;">&nbsp;&nbsp;&nbsp; process.setEnvironment(env)</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; process.start(exe,arg)<br><br>********************************************************************************************************<br>
</span>This code snippet doesn&#39;t work (the txt file isn&#39;t created) but i got no python errors and no QGIS crash so i think i&#39;m just missing something important<br>That&#39;s why i&#39;d really enjoy being in contact with Qgrass developers, to know what&#39;s going wrong<br>
Or may be someone with good knowledge of the QGIS API and Python knows how to do the trick ???<br><br>Any hints, help or advices would be really appreciated<br>Thanks<br><br>PikO<br><br><br><span style="font-style: italic;"></span>