copy & paste style from vector source

Issue #516 resolved
Eike Lie created an issue
  1. If I copy my own style from speclib#1 (left) and paste it to speclib#2 (right), colours will not be adopted correctly.

2. When saving, loading or applying a style from folder in the symbology several errors show up. (the operation works though, but the dialogues are irritating)

An error has occurred while executing Python code:

AttributeError: 'NoneType' object has no attribute 'writeXml'

Traceback (most recent call last):
  File "C:/Users/s-eilief/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\externals\qps\speclib\core.py", line 2532, in exportNamedStyle
    self.mProfileRenderer.writeXml(speclibNode, doc)
  File "C:/Users/s-eilief/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\externals\qps\speclib\core.py", line 1264, in writeXml
    self.profileStyle.writeXml(nodeDefaultStyle, doc)
AttributeError: 'NoneType' object has no attribute 'writeXml'

Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
QGIS version: 3.12.1-București București, 121cc00ff0

Python Path:

  • C:\Users\s-eilief\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\apps\ensomap
  • C:/OSGEO4~1/apps/qgis/./python
  • C:/Users/s-eilief/AppData/Roaming/QGIS/QGIS3\profiles\default/python
  • C:/Users/s-eilief/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
  • C:/OSGEO4~1/apps/qgis/./python/plugins
  • C:\OSGEO4~1\apps\Python37
  • C:\OSGEO4~1\apps\Python37\Scripts
  • C:\OSGeo4W64\bin\python37.zip
  • C:\OSGEO4~1\apps\Python37\DLLs
  • C:\OSGEO4~1\apps\Python37\lib
  • C:\OSGeo4W64\bin
  • C:\OSGEO4~1\apps\Python37\lib\site-packages
  • C:\OSGEO4~1\apps\Python37\lib\site-packages\win32
  • C:\OSGEO4~1\apps\Python37\lib\site-packages\win32\lib
  • C:\OSGEO4~1\apps\Python37\lib\site-packages\Pythonwin
  • C:/Users/s-eilief/AppData/Roaming/QGIS/QGIS3\profiles\default/python
  • C:/Users/s-eilief/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin
  • C:\Users\s-eilief\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\site-packages
  • C:\Users\s-eilief\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\externals\qps\externals
  • C:\Users\s-eilief\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox
  • C:\Users\s-eilief\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\site-packages
  • C:/Users/s-eilief/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\vrtbuilderplugin
  • C:\Users\s-eilief\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\vrtbuilderplugin\vrtbuilder
  • .
  • C:\Users\s-eilief\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\coreapps
  • C:\Users\s-eilief\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\apps

next to:

An error has occurred while executing Python code:

AssertionError

Traceback (most recent call last):
  File "C:/Users/s-eilief/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\externals\qps\speclib\gui.py", line 1235, in onProfileRendererChanged
    self.viewBox().setProfileRenderer(profileRenderer)
  File "C:/Users/s-eilief/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\externals\qps\speclib\gui.py", line 735, in setProfileRenderer
    self.wColorScheme.setProfileRenderer(profileRenderer)
  File "C:/Users/s-eilief/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\externals\qps\speclib\gui.py", line 337, in setProfileRenderer
    self.wDefaultProfileStyle.setPlotStyle(profileRenderer.profileStyle)
  File "C:/Users/s-eilief/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\externals\qps\plotstyling\plotstyling.py", line 818, in setPlotStyle
    assert isinstance(style, PlotStyle)
AssertionError

Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
QGIS version: 3.12.1-București București, 121cc00ff0

Python Path:

  • C:\Users\s-eilief\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\apps\ensomap
  • C:/OSGEO4~1/apps/qgis/./python
  • C:/Users/s-eilief/AppData/Roaming/QGIS/QGIS3\profiles\default/python
  • C:/Users/s-eilief/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
  • C:/OSGEO4~1/apps/qgis/./python/plugins
  • C:\OSGEO4~1\apps\Python37
  • C:\OSGEO4~1\apps\Python37\Scripts
  • C:\OSGeo4W64\bin\python37.zip
  • C:\OSGEO4~1\apps\Python37\DLLs
  • C:\OSGEO4~1\apps\Python37\lib
  • C:\OSGeo4W64\bin
  • C:\OSGEO4~1\apps\Python37\lib\site-packages
  • C:\OSGEO4~1\apps\Python37\lib\site-packages\win32
  • C:\OSGEO4~1\apps\Python37\lib\site-packages\win32\lib
  • C:\OSGEO4~1\apps\Python37\lib\site-packages\Pythonwin
  • C:/Users/s-eilief/AppData/Roaming/QGIS/QGIS3\profiles\default/python
  • C:/Users/s-eilief/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin
  • C:\Users\s-eilief\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\site-packages
  • C:\Users\s-eilief\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\externals\qps\externals
  • C:\Users\s-eilief\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox
  • C:\Users\s-eilief\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\site-packages
  • C:/Users/s-eilief/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\vrtbuilderplugin
  • C:\Users\s-eilief\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\vrtbuilderplugin\vrtbuilder
  • .
  • C:\Users\s-eilief\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\coreapps
  • C:\Users\s-eilief\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\apps

3. Is there any possibility to keep profile styles, when saving it as .sli ?

Comments (10)

  1. Benjamin Jakimow

    SpectralLibraryWidget and AttributeTableWidget: support basic feature filtering (closes #496) Spectral Libraries: - SpectralProfileRenderer: fixed XML input/output to QML files (addresses #516) - SpectralLibrary constructor can be used like QgsVectorLayer (addresses #515) - refactored context menus in SpectralLibraryPlotWidget (addresses #491) - refactored internal unit model - SpectralProfile: supports basic math operators (add/substract/mul/div), like "SpectralProfile() + 3" (addresses #498)

    Signed-off-by: Benjamin Jakimow benjamin.jakimow@geo.hu-berlin.de benjamin.jakimow@geo.hu-berlin.de

    → <<cset c3fc6d044469>>

  2. Eike Lie reporter

    I also noticed, when loading style from qml, you must neither click “apply” nor “ok” but “cancel”-button to set the loaded style. And the map only changes vector when zoomed.

  3. Benjamin Jakimow

    @Eike Lie

    If I copy my own style from speclib#1 (left) and paste it to speclib#2 (right), colours will not be adopted correctly.

    this should be fixed now. You might check alreay in the most-recent developer version

    1. Is there any possibility to keep profile styles, when saving it as .sli ?

    I created #525 for this feature request

  4. Log in to comment