[Qgis-user] Point sampling tool and python console
Xavier Vollenweider
x.y.b.vollenweider at googlemail.com
Thu May 17 09:52:55 PDT 2012
Hi,
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.
So far, I have not much:
crops="Wheat", "Maize","Barley", "Haricot Bean","Teff"
for i in crops: layer=QgsRasterLayer("C:/Program Files/LEAP/Images/Water
Balance/Meher/2005/"+str(i)+"_Meher_Final_Index_2005.img",str(i));
QgsMapLayerRegistry.instance().addMapLayer(layer)
Any one knows what is the function for Point Sampling Tool, Join the layer
and save?
I imagine to join the layer it might be something like:
QgsVectorLayer.addJoin(*joinInfo)
*Any idea for Point Sampling Tool? something with intersect?
Thanks a lot,
Xav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20120517/6b96b0e2/attachment.html>
More information about the Qgis-user
mailing list