EnviSpectralLibraryIO.write is not creating a new ENVI Speclib file

Issue #515 closed
Andreas Janz created an issue

from enmapbox.externals.qps.speclib import EnviSpectralLibraryIO
from enmapbox.externals.qps.speclib.core import SpectralLibrary

speclib= SpectralLibrary(r'C:\Users\janzandr\Downloads\_srf\tm7.gpkg')
EnviSpectralLibraryIO.write(speclib=speclib, path=r'C:\Users\janzandr\Downloads\_srf\tm7.sli')

is not creating the SLI and just finishes without an error

Comments (2)

  1. Benjamin Jakimow

    wrong use of SpectralLibrary constructor

    use "uri" keyword instead.

        def test_issue515(self):
    
            from enmapbox.gui import SpectralLibrary
    
            from enmapbox.externals.qps.speclib import EnviSpectralLibraryIO
            from enmapbox.externals.qps.speclib.core import SpectralLibrary
    
            path = r'C:\Users\geo_beja\Downloads\tm7.gpkg'
            pathDst = r'C:\Users\geo_beja\Downloads\destination.sli'
            if os.path.isfile(path):
                speclib = SpectralLibrary(uri=path)
                self.assertTrue(len(speclib) > 0)
                results = EnviSpectralLibraryIO.write(speclib=speclib, path=pathDst)
                self.assertTrue(len(results) > 0)
                for path in results:
                    self.assertTrue(EnviSpectralLibraryIO.canRead(path))
    
  2. 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>>

  3. Log in to comment