semiautomaticgit / SemiAutomaticClassificationPlugin

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

Problem with ROI in Supervised Classification #177

Closed FranBe closed 2 years ago

FranBe commented 3 years ago

Hello! I have these errors when I want to start to create a ROI:

Traceback (most recent call last): File "C:/Users/isabel/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\dock\scpdock.py", line 2411, in saveROItoShapefile cfg.utls.calculateSignature(cfg.shpLay, cfg.bandSetsList[bandSetNumber][8], [self.ROILastID], cfg.ROIMacroID, cfg.ROIMacroClassInfo, cfg.ROIID, cfg.ROIInfo, 50, 40, 'No', 'No', UID, bandSetNumber = bandSetNumber) File "C:/Users/isabel/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\core\utils.py", line 1584, in calculateSignature rStatStr = str(rStat) UnboundLocalError: local variable 'rStat' referenced before assignment

2021-05-24T21:06:22 WARNING warning:/home/blues/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/dock/scpdock.py:2527: DeprecationWarning: an integer is required (got type float). Implicit conversion to integers using int is deprecated, and may be removed in a future version of Python. clr.setAlpha(rT)

traceback: File "/home/blues/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/dock/manualroi.py", line 56, in canvasReleaseEvent self.rightClicked.emit(pnt) File "/home/blues/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/dock/scpdock.py", line 2652, in clckR self.addHighlightPolygon(cfg.lstROI, 1) File "/home/blues/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/dock/scpdock.py", line 2527, in addHighlightPolygon clr.setAlpha(rT

That happens just at the beginning, when I pick the first point of the first polygon. Just after install SCP, I've got these warnings when opening QGIS:

2021-05-24T21:06:22 WARNING warning:/home/blues/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/dock/scpdock.py:2527: DeprecationWarning: an integer is required (got type float). Implicit conversion to integers using int is deprecated, and may be removed in a future version of Python. clr.setAlpha(rT)

traceback: File "/home/blues/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/dock/manualroi.py", line 56, in canvasReleaseEvent self.rightClicked.emit(pnt) File "/home/blues/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/dock/scpdock.py", line 2652, in clckR self.addHighlightPolygon(cfg.lstROI, 1) File "/home/blues/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/dock/scpdock.py", line 2527, in addHighlightPolygon clr.setAlpha(rT I use Debian 10 , but I've got the problem on Ubuntu 20 (Focal Fossa) too. I have python3, scipy, numpy, pandas, gdal, and SNAP installed on both systems and when I run the Debug of SCP, there isn't any problem. I received the same errors using QGIS 3.16 and 3.18, with SCP 7.1, 7.2, 7.3. I tried installing SCP from the repository in QGIS, and directly from an archive (official website).

Thaks!

semiautomaticgit commented 3 years ago

Hello, please update the plugin to the latest version. Also, please copy the log file following these steps https://semiautomaticclassificationmanual.readthedocs.io/en/latest/faq.html#how-can-i-report-an-error

semiautomaticgit commented 2 years ago

I'm closing this, but feel free to reopen if you still get he same issue. Thank you