<div dir="ltr"><div><div><div>I've asked about this several time and have never gotten a real response. The following code creates two memory layer polygons that overlap.<br><br><span style="font-family:monospace,monospace">from qgis.core import (QgsFeature,<br>    QgsVectorLayer, QgsPoint, QgsFeature,<br>    QgsMapLayerRegistry)<br>    <br>poly1 = QgsVectorLayer("Polygon?crs=epsg:4326", "Polygon 1", "memory")<br>dp = poly1.dataProvider()<br><br>pts = [QgsPoint(-117.9031, 44.4169), QgsPoint(-103.86080, 44.700146), QgsPoint(-104.655656, 38.257599), QgsPoint(-117.9031, 44.4169)]<br>f = QgsFeature()<br>f.setGeometry(QgsGeometry.fromPolygon([pts]))<br>dp.addFeatures([f])<br>poly1.updateExtents()<br>QgsMapLayerRegistry.instance().addMapLayer(poly1)<br><br>poly2 = QgsVectorLayer("Polygon?crs=epsg:4326", "Polygon 2", "memory")<br>dp = poly2.dataProvider()<br><br>pts = [QgsPoint(-115.27676, 40.242037), QgsPoint(-101.32007, 41.387353), QgsPoint(-102.1608432, 33.314810), QgsPoint(-115.27676, 40.242037)]<br>f = QgsFeature()<br>f.setGeometry(QgsGeometry.fromPolygon([pts]))<br>dp.addFeatures([f])<br>poly2.updateExtents()<br>QgsMapLayerRegistry.instance().addMapLayer(poly2)</span><br><br></div>From the QGIS menu if you run the Geoprocessing tools such as Intersection or Difference on the two polygons the algorithms fail to return the correct results. Are memory layers no longer supported in QGIS or is this a bug in the Processing code? In QGIS 14 this code works fine, but with QGIS 18.x and QGIS 2.99 it fails.<br><br></div>Thanks,<br><br></div>Calvin<br></div>