[Qgis-developer] question about r.in.xyz

Tim Sutton tim at linfiniti.com
Tue Dec 4 09:05:15 EST 2007


Hi

Caveat: I dont know much about python...

2007/12/4, PikoBoZ <piklas at gmail.com>:
>
> Hi list
> I'd like to use r.in.xyz from a python plugin in the aim to extract the
> x,y,z values of a tiff dem file to an ascii file. I know that grass tools
> aren't supported yet in PyQGIS, but i'm going to call directly the
> r.in.xyz.exe of the grass directory with an os command. I have actually two
> questions
>
> How can set any loaded dem layer as the current layer to work with ?
>

There should be a python equivalent call to this:

mpMapCanvas->setCurrentLayer(0);

The parameter being the index of the layer in teh canvas that you want
to be active.

> Can I specify arguments into a os.system command as in a traditionnal grass
> command
> os.system('r.in.ascii.exe') input=~/CURRENT LAYER  output=rast
>
> Which python syntax or os command must i use to do that ?
>

I dont know python but since I guess you are using PyQt, isnt QProcess
available to you? With qprocess you can pass arbitary arguments to the
command - see docs at

http://doc.trolltech.com/4.3/qprocess.html

Hope that helps a little...regards

Tim

> Many Thanks 4 answers
>
> PikO
> --
> View this message in context: http://www.nabble.com/question-about-r.in.xyz-tf4942926.html#a14150060
> Sent from the qgis-developer mailing list archive at Nabble.com.
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.qgis.org
> http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
>


-- 
Tim Sutton
QGIS Project Steering Committee Member - Release  Manager
Visit http://qgis.org for a great open source GIS
openModeller Desktop Developer
Visit http://openModeller.sf.net for a great open source ecological
niche modelling tool
Home Page: http://tim.linfiniti.com
Skype: timlinux
Irc: timlinux on #qgis at freenode.net



More information about the Qgis-developer mailing list