Hello,
I have a few questions related to writing RAT columns.
When it comes to writing columns to a clumps file attribute table unless I use this function first on the clumps raster...
populateImageStats(inputImage, clumpsFile, calcMean=True)
.... I am unable to add additional attribute columns from a numpy array. So omitting the line above I get this error when writing to the RAT:
File "<ipython-input-30-c39e947d62c0>", line 1, in <module>
rat.writeColumn(ratDataset, 'B1mean', Mn1)
File "/home/ubuntu/anaconda3/lib/python3.4/site-packages/rios/rat.py", line 330, in writeColumn
gdalBand = ds.GetRasterBand(bandNumber)
UnboundLocalError: local variable 'ds' referenced before assignment
So I am not interested in the columns produced from the populateImageStats function, but am curious as to why I appear to be unable to write additional columns without first applying this function?
What else is it doing 'under the hood' to the kea file that prepares it for adding columns? Could anyone tell me how I can prepare the kea file for attribute writing without the populateImageStats function?
Many thanks
Ciaran