Speclib: AttributeError: 'QgsVectorLayer' object has no attribute 'addProfiles'

Issue #826 resolved
Fabian Thiel created an issue
  • Open library_berlin
  • Collect a spectrum somewhere in the EnMAP image
  • The error occurs

I know, this should not work as the spectral resolution is different and presumably as the testdata library has no geometry. But the error message indicates there might be something wrong? Maybe a warning should show up if map spectra can not be added to library for whatever reason

An error has occurred while executing Python code: 

AttributeError: 'QgsVectorLayer' object has no attribute 'addProfiles' 
Traceback (most recent call last):
  File "/root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/gui/enmapboxgui.py", line 1288, in 
    lambda crs, pt, c=canvas: self.setCurrentLocation(SpatialPoint(crs, pt), canvas)
  File "/root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/gui/enmapboxgui.py", line 1724, in setCurrentLocation
    self.loadCurrentMapSpectra(spatialPoint, mapCanvas)
  File "/root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/gui/enmapboxgui.py", line 1346, in loadCurrentMapSpectra
    panel.loadCurrentMapSpectra(spatialPoint, mapCanvas=mapCanvas, runAsync=runAsync)
  File "/root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectralprofilesources.py", line 2286, in loadCurrentMapSpectra
    return self.mBridge.loadProfiles(spatialPoint, mapCanvas=mapCanvas, runAsync=runAsync)
  File "/root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectralprofilesources.py", line 1689, in loadProfiles
    slw.setCurrentProfiles(RESULTS[speclib.id()],
  File "/root/.local/share/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapbox/externals/qps/speclib/gui/spectrallibrarywidget.py", line 515, in setCurrentProfiles
    addedKeys = speclib.addProfiles(currentProfiles)
AttributeError: 'QgsVectorLayer' object has no attribute 'addProfiles'


Python version: 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0] 
QGIS version: 3.22.0-Białowieża Białowieża, exported 

Comments (11)

  1. Andreas Janz

    @Benjamin Jakimow , as I merged dev into master, I got a conflict, which I resolved by using the dev version. Maybe something went wrong here:

  2. Benjamin Jakimow

    @Andreas Rabe please never merge conflicts. Solve them first. What was the conflict about?

  3. Benjamin Jakimow

    | I solved by using the DEV version.
    Sure? The conflicted file now exists in the develop but should’nt be there any more

  4. Benjamin Jakimow

    I added my commit by rebase and updated qps. qps/speclib/gui.py should not exist anymore (as was before)

  5. Log in to comment