[Qgis-developer] Re: Point sampling tool and python console

Xavier x.y.b.vollenweider at googlemail.com
Wed May 23 01:26:34 PDT 2012


Hi Martin,

Thanks a lot for your help. I will try the different options you proposed. I
solved my problem in between my doing it manually with the GUI, it was a bit
long but OK.

Thanks again,

Xav


Martin Dobias wrote
> 
> Hi Xavier
> 
> On Sun, May 20, 2012 at 8:10 PM, Xavier Vollenweider
> <x.y.b.vollenweider@> wrote:
>> Hi all,
>>
>> I am new to QGIS and to Python.
>>
>> I would like to use the plugin point sampling tool in order to merge
>> raster
>> datasets with my observations (a delimited text layer) and then save the
>> resulting shape file as a csv file. I know how to do it with the GUI:
>>
>> Add Delimited Text Layer
>> Add Raster Layer
>> Point Sampling Tool
>> Join the layer
>> Save as .csv
>>
>> As I have quite a lot of raster dataset to match with my observations
>> (and I
>> am quite keen to learn Python), I would like to do it with a loop in the
>> Python console.
> 
> Right now most of the plugins are not prepared to be used from a
> console (or from a script) because many times their algorithms are
> bound to GUI. But in case some plugins are well-written with separated
> GUI from logic, you could use them - it is possible to access plugins
> from console - this will show a dictionary with plugin names and
> instances:
>>>> qgis.utils.plugins
> (There are even methods for loading and unloading python plugins)
> 
> So to call a plugin's routine, you would do something like this:
>>>> qgis.utils.plugins['super_plugin'].do_something( my_data )
> 
> Another option is to look at the plugin that has the functionality you
> need and use the some pieces of code directly in your script.
> 
> Yet another option seems to be SEXTANTE - a plugin that brings a
> common interface for algorithms. It should also allow you to run
> algorithms from batch script.
> 
> Martin
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at .osgeo
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 


--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Point-sampling-tool-and-python-console-tp4975797p4976302.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.


More information about the Qgis-developer mailing list