I have two polygon features: epoca and result.
I would like to select the features that correspond to the number 1 feature (features A and B) and then select the corresponding features with the number 2 feature (features C and D).
I had done the following:
from processing.core.Processing import Processing import processing.tools layerResult = processing.getObject('lyr_result') layerEpoca = processing.getObject('lyr_epoca') processing.tools.general.runalg('qgis:selectbylocation', layerResult, layerEpoca, u'equals', 0.005,0) layerResult.invertSelection() #I'm searching for the different polygons selectFeatures = layerResult.selectedFeatures() #are the features selected in result processing.tools.general.runalg('qgis:selectbylocation',layerEpoca, layerResult, u'within', 0.005,0) #here select the features in epoca all at once!
What is being done is that you are selecting features A, B and C, D at the same time. I would like to select these features at different times. Is this possible?
I had thought of something like this:
for feat in selectFeatures: processing.tools.general.runalg('qgis:selectbylocation',layerEpoca, selectFeatures, u'within', 0.005,0) #----but it did not work----#