Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I worked it out...so you have to include most of the answer 2. buffer = end_point.buffer(20, 4) #Xm buffer with 4 segments buffer_lyr=QgsVectorLayer("Polygon?crs=epsg:28355","buffer", "memory") f = QgsFeature() f.setGeometry(buffer) buffer_lyr.dataProvider().addFeatures([f]) QgsProject.instance().addMapLayer(buffer_lyr) Seems excessive but works. I thought it would be simpler as the geometry object already exists.
I tried buffer_lyr=QgsVectorLayer("Polygon?crs=epsg:28355","buffer", "memory") QgsProject.instance().addMapLayer(buffer_lyr) and it added but no data in the table/no object visible even though the points to build the buffer are there as per the example in my question.
Also happens in the Dev version -QGIS version 3.27.0-Master QGIS code revision b0d60567e5 Qt version 5.15.3 and you see Qt: Retrying to obtain clipboard. but everything seems to work fine.