ubarsc / python-fmask

A set of command line utilities and Python modules that implement the ‘fmask’ algorithm
https://www.pythonfmask.org
GNU General Public License v3.0
75 stars 21 forks source link

AttributeError: 'NoneType' object has no attribute 'ChangesAreWrittenToFile' #2

Closed gillins closed 8 years ago

gillins commented 8 years ago

Original report by Anonymous.


When running the following from the Windows command-line:

#!python

python C:\Anaconda3\envs\HOTBAR\Scripts\fmask_usgsLandsatStacked.py -t thermal.img -a toa.img -m LE72020242003106EDC00_MTL.txt -s saturationmask.img -o cloud_NEW.bsq

I get the following output:

#!python

Traceback (most recent call last):
  File "C:\Anaconda3\envs\HOTBAR\Scripts\fmask_usgsLandsatStacked.py", line 107, in <module>
    mainRoutine()
  File "C:\Anaconda3\envs\HOTBAR\Scripts\fmask_usgsLandsatStacked.py", line 104, in mainRoutine
    fmask.doFmask(fmaskFilenames, fmaskConfig)
  File "C:\Anaconda3\envs\hotbar\lib\site-packages\fmask\fmask.py", line 154, in doFmask
    pass1file)
  File "C:\Anaconda3\envs\hotbar\lib\site-packages\fmask\fmask.py", line 1155, in finalizeAll
    b"Cloud Shadow", b"Snow"])
  File "C:\Anaconda3\envs\hotbar\lib\site-packages\rios\rat.py", line 332, in writeColumn
    writeColumnToBand(gdalBand, colName, sequence, colType, colUsage)
  File "C:\Anaconda3\envs\hotbar\lib\site-packages\rios\rat.py", line 231, in writeColumnToBand
    if not attrTbl.ChangesAreWrittenToFile():
AttributeError: 'NoneType' object has no attribute 'ChangesAreWrittenToFile'

In this case I have the default RIOS output set to 'ENVI' - but I get a similar error if I set the default output to GTIFF.

Any ideas?

gillins commented 8 years ago

Original comment by Sam Gillingham (Bitbucket: gillins, GitHub: gillins).


Currently only formats that support raster attribute tables work. I will stop it giving this error with other formats when I get back from leave.

gillins commented 8 years ago

Original comment by Sam Gillingham (Bitbucket: gillins, GitHub: gillins).


Fixed in RIOS commit b7f8d5b.