semiautomaticgit / SemiAutomaticClassificationPlugin

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

bool has no attribute geometry on Training Areas creation #28

Closed merkato closed 6 years ago

merkato commented 6 years ago

QGIS 2.99/ SCP 6.0 ;)

When I start to add training area, polygon is drawn, but there's no class in the signature list (autosave checked). If I tried to use 'Save temporary ROI to training input' QGIS throws error:

2018-01-23T06:21:18 WARNING Traceback (most recent call last):
              File "/home/mechanik/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/dock/scpdock.py", line 2431, in saveROItoShapefile
                cfg.utls.copyFeatureToLayer(cfg.lstROI, 0, cfg.shpLay)
              File "/home/mechanik/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/core/utils.py", line 6253, in copyFeatureToLayer
                fG = f.geometry()
            AttributeError: 'bool' object has no attribute 'geometry'

            During handling of the above exception, another exception occurred:

            Traceback (most recent call last):
              File /home/mechanik/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/dock/scpdock.py", line 2434, in saveROItoShapefile
                cfg.utls.copyFeatureToLayer(cfg.lstROI, 1, cfg.shpLay)
              File "/home/mechanik/.local/share/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/core/utils.py", line 6255, in copyFeatureToLayer
                sF = targetLayer.pendingFields()
            AttributeError: 'QgsVectorLayer' object has no attribute 'pendingFields'
semiautomaticgit commented 6 years ago

Thank you very much for reporting this. It should be fixed in version 6.0.1.

Best, Luca