Using QGIS 3.4.4, I'm trying to save a layer as shapefile with the following code:
import qgis.core import os working_folder = r'C:\myFolder' fc_Prospect = os.path.join(working_folder, Equipment.gdb|layername=Prospect') layer1 = QgsVectorLayer(fc_Prospect, 'Prospect', 'ogr') path = r'C:\myFolder\test.shp' _writer = QgsVectorFileWriter.writeAsVectorFormat(layer1,path,'utf-8','ESRI Shapefile')
However, I am getting this error:
TypeError: QgsVectorFileWriter.writeAsVectorFormat(): arguments did not match any overloaded call:
overload 1: argument 4 has unexpected type 'str'
overload 2: argument 4 has unexpected type 'str'
overload 3: argument 3 has unexpected type 'str'
I am quite new with python, so I am not sure what this error means. I've been checking documentation at https://qgis.org/pyqgis/master/core/QgsVectorFileWriter.html#qgis.core.QgsVectorFileWriter.writeAsVectorFormat, but it didn't really help.