I want to edit the code I have below to save vector files as vectors and also save vector files as KMZs.
The code I have does a mass save to my temporary folder but only for rasters.
myDir = r'C:\temp'
layers = layers = iface.mapCanvas().layers()
pipe = QgsRasterPipe()
for layer in layers:
extent = layer.extent()
width, height = layer.width(), layer.height()
renderer = layer.renderer()
provider=layer.dataProvider()
crs = layer.crs().toWkt()
pipe.set(provider.clone())
pipe.set(renderer.clone())
file_writer = QgsRasterFileWriter("%s\\%s.tif" %(myDir, layer.name() ))
file_writer.writeRaster(pipe,
width,
height,
extent,
layer.crs())
print "%s\\%s.tif" %(myDir, layer.name() )