semiautomaticgit / SemiAutomaticClassificationPlugin

https://fromgistors.blogspot.com/p/semi-automatic-classification-plugin.html
Other
136 stars 50 forks source link

Spectral signature plot fails #247

Closed ecodiv closed 1 year ago

ecodiv commented 1 year ago

When using the option to add signatures to spectral signature plot, I am getting the following error:

2022-12-11T12:04:57     WARNING    Traceback (most recent call last):
              File "C:\Users/brp/AppData/Roaming/QGIS/QGIS3\profiles\SCP/python/plugins\SemiAutomaticClassificationPlugin\spectralsignature\spectralsignatureplot.py", line 334, in signatureListPlotTable
              cfg.utls.addTableItem(l, "checkbox", x, 0, 'Yes', None, cfg.spectrPlotList["CHECKBOX_" + str(k)])
             KeyError: 'CHECKBOX_20221210_184550574901_830'

             During handling of the above exception, another exception occurred:

             Traceback (most recent call last):
              File "C:\Users/brp/AppData/Roaming/QGIS/QGIS3\profiles\SCP/python/plugins\SemiAutomaticClassificationPlugin\dock\scpdock.py", line 987, in calculateSignatures
              cfg.spSigPlot.signatureListPlotTable(cfg.uisp.signature_list_plot_tableWidget)
              File "C:\Users/brp/AppData/Roaming/QGIS/QGIS3\profiles\SCP/python/plugins\SemiAutomaticClassificationPlugin\spectralsignature\spectralsignatureplot.py", line 351, in signatureListPlotTable
              cfg.mx.msgErr57("MC" +str(cfg.signList["MACROCLASSID_" + str(k)]) + ";C" + str(cfg.signList["CLASSID_" + str(k)]) + ";" + str(cfg.signList["CLASSINFO_" + str(k)]) )
             KeyError: 'MACROCLASSID_20221210_184550574901_830'
semiautomaticgit commented 1 year ago

Hello @ecodiv , it seems that the training input got corrupted. Please try to create a new training input file and create new ROIs or try to import the previous ROIs using this tool https://semiautomaticclassificationmanual.readthedocs.io/en/latest/importSignaturesTab.html#import-library-file

ecodiv commented 1 year ago

Thanks, I tried creating a vector layer and than import it. Gave me the same error. Finally, starting from scratch, creating new training data a third time worked. Makes me wonder what can cause the corruption. But it works now 😊

semiautomaticgit commented 1 year ago

@ecodiv you are very welcome! I'm glad that it works.