export raster values

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

export raster values

piko
Hi list !
For a specific python plugin i need to export raster values to a tabular x,y,z file
i've try to access r.out.ascii.exe by calling rxvt.exe (mingv shell on windows) from python and giving command file as argument, but it's a bit messy, and doesn't produce a tabular result.
Would it be possible to do it only with python ?? (without having to work with grasstools ?)
Any ideas ?
thanks 4 answers.

PikoBoz


Reply | Threaded
Open this post in threaded view
|

Re: export raster values

Tim Sutton
Hi

What not call the grass commands from python using QProcess or pythons
built in system process facilities? This is in fact the way most grass
tools are called internally by QGIS too.



Regards

Tim


2008/1/17, PikoBoZ <[hidden email]>:

>
> Hi list !
> For a specific python plugin i need to export raster values to a tabular
> x,y,z file
> i've try to access r.out.ascii.exe by calling rxvt.exe (mingv shell on
> windows) from python and giving command file as argument, but it's a bit
> messy, and doesn't produce a tabular result.
> Would it be possible to do it only with python ?? (without having to work
> with grasstools ?)
> Any ideas ?
> thanks 4 answers.
>
> PikoBoz
>
>
>
> --
> View this message in context: http://www.nabble.com/export-raster-values-tp14918677p14918677.html
> Sent from the qgis-developer mailing list archive at Nabble.com.
>
> _______________________________________________
> Qgis-developer mailing list
> [hidden email]
> 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
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

export raster values

piko
Thanks for your answer Tim.

I'm searching some concrete examples of QProcess used in Python. Anyone ?

Given that i setup a mapset in my python code and that i have a 'laymnt'  variable that sets the current raster layer to work with, how can i do that in a proper way (doesn't work yet) :

self.start('r.out.ascii.exe', 'input=laymnt output=mnttxt')

Is it possible to pass grass comands directly in the string or must i use a file with commands in it ?

my goal is too write x,y,z values of any loaded elevation raster in mnttx, and then redirect this file to an other .exe that calculate atmospheric dispersion according to local topography and  meteo input data.

Any ideas very appreciated.

PikO

 

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer