import sys
sys.path.append("c:\\osgeo4w64\\app\qgis\\pyto\\plugins")
import processing, os,glob
layer1 = QgsVectorLayer(layer1ShpFilePath, "layer1", "ogr")
layer2 = QgsVectorLayer(layer2ShpFilePath, "layer2", "ogr")
params = {
'INPUT': layer1,
'OVERLAY': layer2,
'OUTPUT': "TEST.shp"
}
intersectLayer = processing.run("saga:intersect", params)
I wanted to use pyQgis to find out the intersect polygon between 2 vector layer, but I always encountered error AttributeError: module 'processing' has no attribute 'run' Can anyone please help me? I am writing a python using QGis on a window machine, I have already added the basic QGIS path to the environment variables, but I am no sure if I need to add SAGA package to the window environment variables.