Raster calculator is not working correctly for a single calculation using a standalone Python script. I am trying to add 1 to a pre-existing raster. It processes, but the resulting tiff file is all 0s. I have used similar code for other rasters and calculations which work, but this one does not.
entries = []Layer1 = QgsRasterLayer('input.tif', "Lyr1")print(Layer1.isValid()) # it is validras = QgsRasterCalculatorEntry()ras.ref = 'lyr1@1'ras.raster = Layer1ras.bandNumber = 1entries.append(ras)calc = QgsRasterCalculator('"lyr1@1"+1', 'output.tif', 'GTiff', \Layer1.extent(), Layer1.width(), Layer1.height(), entries)calc.processCalculation()