For a school assignment I need to write a QGIS plugin. Part of the plugin that i'm writing needs to use the 'select by location' processing tool on a previously created buffer.
The codelines that I want to use is:
def selectBagFromOverlapBuffer(self): self.layer1 = QgsProject.instance().mapLayersByName('bag:verblijfsobject') self.layer2 = QgsProject.instance().mapLayersByName('buffer') processing.runalg('qgis:selectbylocation',self.layer1, self.layer2,u'within',0)
The error message I get is "module 'processing' has no attribute 'runalg' Is there a step I'm missing with accesing processing tools from a plugin .py script?