Hello, I would like to batch-write some raster files from a project to one common folder using a script. This is my function:
def writeRaster(rasterObj, pathToFile, cols, rows, rasterExtentObj, rasterCRSObj): provider = myRaster.dataProvider() pipe = QgsRasterPipe() pipe.set(provider.clone()) file_writer = QgsRasterFileWriter(pathToFile) file_writer.writeRaster(pipe, cols, rows, rasterExtentObj, rasterCRSObj) (Its a slightly modified example I found at nullege.com.) For normal rasters this works just fine, but not for maps (scanned and georeferenced). The map colors are recoded to grey-values, as one could expect. Is there a way to keep the colors? From what I have seen, there is no parameter to handle this in a QgsRasterPipe(). Also, I remember once I tried to create a virtual raster cataloge using these maps. That failed because the maps used different color palettes. I guess they should be in RGB to create the vrt cataloge, shouldn't they? Thanks for suggestions, Torsten
_______________________________________________ Qgis-user mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-user
