<div dir="ltr"><div>Hello,</div><div><br></div><div>this is my code:<br></div><div><br></div><div>---</div><div>id_ = 'my_layer_2bbd2539_97b3_417d_8a2a_97ec4f755a82'<br></div><div><br></div><div>crs = QgsCoordinateReferenceSystem()<br>crs.createFromString('epsg:4326')<br><br>crs2 = QgsCoordinateReferenceSystem()<br>crs2.createFromString('epsg:32632')<br><br>lay = QgsProject.instance().mapLayers()[id_]<br><br>lay.selectByExpression('"fclass" = \'{}\''.format(w))<br>new = processing.run('native:saveselectedfeatures', {'INPUT': lay, 'OUTPUT': 'memory:'})['OUTPUT']<br><br>opts = QgsVectorFileWriter.SaveVectorOptions()<br>opts.fileEncoding = 'UTF-8'<br>opts.driverName = 'ESRI Shapefile'<br>if os.path.exists('/home/rr/test.shp'):<br>    opts.actionOnExistingFile = QgsVectorFileWriter.ActionOnExistingFile.AppendToLayerAddFields # important<br><br>ctx = QgsCoordinateTransformContext()<br>ctx.addCoordinateOperation(crs, crs2, '', False)<br><br>err = QgsVectorFileWriter.writeAsVectorFormatV2(new, '/home/rr/test.shp', ctx, opts)<br><br>lay.removeSelection()</div><div>---</div><div><br></div><div>The result still has WGS84-coordinates. What I'm doing wrong?<br></div><div><br></div><div>I can't use native:reprojectlayer because I need the append-feature from the 
QgsVectorFileWriter.</div></div>