I am comparing geometries of input layer and output layer features. I want to delete features in output layers which has equal geometry to input feature. I am using following code to do that.
for feat in drain.getFeatures(): for f in outLayer.getFeatures(): if feat.geometry().equals(f.geometry()): outLayer.dataProvider().deleteFeatures([f.id()]) outLayer.updateFeature(f)
This code deletes features in output layer but while removing output layer from the Qgis desktop, input layer geometries disappears but features are there in attribute table.
What changes can I make in the code to make it work properly? Here I am adding an image to make my doubt more clearer.
Here, "drain"is an input layer which is open in Qgis screen, it has attributes but features are not displayed(or visible) on the screen. It was coming correctly before executing the code given above.