Bug report #18006
Geoprocessing Tools Fail with Memory Layers in QGIS 2.18
|Affected QGIS version:||2.18.16||Regression?:||Yes|
|Operating System:||Windows||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||duplicate|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||25902|
I have attached a python script to illustrate this bug. I posted this problem on the qgis-developer group and Richard Duivenvoorde confirmed the problem. This problem appears to only affect QGIS 2.18.x. Richard tested it on QGIS 3.0 and it works fine. example1.jpg and exmple2.jpg were run using 2.14 to show the correct results.
Run two-polygons.py and it will create two polygons (see example1.jpg). Note that I have given Polygon 2 some transparency so you can see how they overlap. Now run "Vector->Geoprocessing Tools->Clip". I used 'Polygon 1' for the 'Input vector layer' and 'Polygon 2' for the 'Clip layer'. QGIS 2.14 produces the correct results as shown by example2.jpg. QGIS 2.18.16 does not clip. It returns 'Polygon 1' as shown by qgis2.18example.jpg.
This example just shows the Clip function but I think all of the Geoprocessing Tools have issues. 'Intersection' gives the same results. 'Symmetrical difference' and 'Difference' don't return any polygon result, but they should both return a result. I have not checked the rest.