Sunday 29 January 2017

qgis - How to use QgsOverlayAnalyzer class in pyQGIS?


I am very new to Python scripting in QuantumGIS, so bear with me please.


I am trying to use the QgsOverlayAnalyzer class in QuantumGIS (http://www.qgis.org/api/classQgsOverlayAnalyzer.html#details) to automate the intersection between different layers (I have plenty of intersections to do).


However, I can't get it to work in the python console.. assume I want to intersect layer1 with layer2, and write the results in C:\shapefile.shp, I am trying something like this with no success:


QgsOverlayAnalyzer.intesection(layer1, layer2, "C:\shapefile.shp", false, 0)

The error I make must be quite serious, as the message I get is:



NameError: name 'QgsOverlayAnalyzer' is not defined

Any help on this is very much appreciated.


Dom




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...