mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
To create a 2x2 raster block with one byte per pixel: ``` block = QgsRasterBlock(Qgis.Byte, 2, 2) block.setData(b'\xaa\xbb\xcc\xdd') ``` To overwrite existing raster data at position 0,0 by the 2x2 block: ``` provider.setEditable(True) provider.writeBlock(block, band, 0, 0) provider.setEditable(False) ```