I am using QGIS raster calc as below. Now I am saving it as a tiff. But is there a way that I can save it as a memory layer?
I want to refer to that resulting memory layer and polygonize it, and upload it to postgis server. Because I am building a plugin so I don't want user to specify a folder to save the tif.
layer = QgsRasterLayer(path_of_image, 'input') name = layer.name() resultinglayer = QgsRasterCalculatorEntry() resultinglayer.ref = name + "@1" resultinglayer.raster = layer resultinglayer.bandNumber = 1 entries = [resultinglayer] calc = QgsRasterCalculator('(%s@1)*0' % name, 'C:/tom/ras.tif', 'GTiff', layer.extent(), layer.width(), layer.height(), entries) calc.processCalculation()