Skip to main content
2 of 5
naming
Vince
  • 20.3k
  • 16
  • 48
  • 65

Save shapefile with QgsVectorFileWriter

I've tried to create vector file (shapefile) with QgsVectorFileWriter. This is my code:

path = "/home/camilocorredor/Documentos/ANT/4_Abril/File.shp"    
options = QgsVectorFileWriter.SaveVectorOptions()
options.driverName = "ESRI Shapefile"

    
QgsVectorFileWriter.writeAsVectorFormatV2(layer_test, path, QgsCoordinateTransformContext(), options)

The vector file never is created on the folder.

Any suggesting?