Bug report #16524

Updated by Giovanni Manghi almost 7 years ago

This issue is applicable to some of the other Geoprocessing tools, but I have only really investigated Difference.

This is a bug report where Difference fails. Create two memory layer polygons in QGIS 2.18.7. In my case I created a large triangle and then an inner triangle for a second layer. If I run "Geooprocessing Tools->Difference" with the small triangle as the difference layer, I get an empty difference layer. I tried this specifying a temporary layer and a shapefile as the output layer and both fail. If I first save the two input memory layers as shapefiles and then do the same thing, it works correctly and I get a proper difference layer of a triangle with a hole in it. I also tested QGIS 2.14.7 and it works correctly so this is only failing in 2.18.

To create the shapes I used the "New Memory Layer" plugin to create polygon memory layers and then hand drew the shapes. I have also tried it with the "Shape Tools" plugin to create the shapes. It doesn't matter how the memory layers are created. I get the same results.

This is also true when creating layers with (example)

QgsVectorLayer("Polygon?crs=epsg:4326", "Layer Name", "memory")

Back