I'm looking for some examples to do simple python scripts in QGIS. How would I do a buffer analysis on a dataset?
I can't seem to find much in the manual and QGIS python that quite matches the Esri documentation.
|
|
|
Have a look at the PyQGIS Cookbook. Follow the example on how to iterate over a vector layer. Accessing the geometry, you can apply the buffer() method. See also the QGIS API: http://www.qgis.org/api/classQgsGeometry.html#a98208752e1beb1a5d3a7eedffbfdb2e4 |
|||||
|
|
Just a little thing to add to the last reply. To search for a SEXTANTE algorithm about a given topic, use Sextante.alglist(). For instance, in the case of searching for something containing "buffer", you would do
And you would get:
That way, you can find the name of the algorithm to call (ftools:fixeddistancebuffer, in the example proposed in the reply above) You can turn your script into a new algorithm in SEXTANTE. The SEXTANTE documentation has detailed information about that. |
||||
|
|
if you wanna a basic code, you can check out following code:
i hope it helps you... |
|||||||||||
|
|
You have different ways to get what you want by PyQGIS Console:
To get the sextante parameters type Hope this helps ! |
||||
|
|