I have created a raster.tiff file using GDAL driver with data type as Byte and have also added a palette of unique values to it (0,1,2).
When i try to write a pixel value for a particular Raster Band the value is not getting updated.
I have tried using FlushCache() and del variables, but nothing seems to work.
rasterDS=gdal.Open("C:/Anuj/fyp/Delhi_Sample/Clutter/raster.tiff")
rasterBand=rasterd.GetRasterBand(1)
rasterArray=rasterb.ReadAsArray()
rasterArray[0][1]
1
rasterArray[0][1]=2
rasterBand.WriteArray(rasterArray)
0
rasterBand.FlushCache()
rasterDS.FlushCache()
rasterBand=None
rasterDS=None
del rasterBand
del rasterDS
rasterDS=gdal.Open("C:/Anuj/fyp/Delhi_Sample/Clutter/raster.tiff")
rasterBand=rasterd.GetRasterBand(1)
rasterArray=rasterb.ReadAsArray()
rasterArray[0][1]
1
The pixel value is not getting updated after writing the array to the raster band.