I'm trying to find a very simple solution to reproject a vector layer into a temporary layer in PyQGIS, however documentation is really extensive and I'm fairly new to PyQGIS; the only answer I've found here saves the layer, which I totally want to avoid.
The code I've tried:
layer = QgsVectorLayer("/path/file.gpkg", "oko", "ogr")
epsg_crs = QgsCoordinateReferenceSystem(4326, QgsCoordinateReferenceSystem.EpsgCrsId)
layer.setCoordinateSystem(epsg_crs)
And this error I got:
Traceback (most recent call last): File "/usr/lib/python3.6/code.py", line 91, in runcode exec(code, self.locals) File "<input>", line 1, in <module> TypeError: QgsVectorLayer.setCoordinateSystem(): too many arguments