I'm a beginner in PyQGIS and need help to figure out how to automate a process in QGIS.
I want to write a script that enables me to loop inside a polygon shapefile (shown in brown) and use extent of each polygon to clip another shapefile (shown in yellowish).
Below is what I figured out so far:
loc_brown= 'D:/Python_Calcs/SHP_PR/brown.shp' loc_yellow = 'D:/Python_Calcs/SHP_PR/yellow.shp' layer_brown = QgsVectorLayer(loc_brown,'','ogr') layer_yellow = QgsVectorLayer(loc_yellow,'','ogr') for feat in layer_brown.getFeatures(): attrs = feat.attributes() print(attrs) clip = processing.run("native:clip",'INPUT':layer_yellow,'OVERLAY':????,'OUTPUT':"D:/Python_Calcs/tmp/"+"clip_"+str(attrs)+".shp"})