vector layer with binary field is not considered a valid spectral library anymore

Issue #724 resolved
Andreas Janz created an issue

Several unit tests related to spectral libraries are broken recently. It seams that a vector layer with a binary field is not sufficient anymore.

>>>print(QgsVectorLayer(filename).featureCount())
>>>print(QgsVectorLayer(filename).fields().field('profiles').typeName())
>>>print(SpectralLibrary(filename, profile_fields=['profiles']).featureCount())
58
Binary
-1

Please enable this again and do not check against the specific SpectralProfiles Attribute Form.

Comments (9)

  1. Benjamin Jakimow

    The “profiles” field in library.gpkg defines an unknown editor widget id Spectral Profile:

    iface.activeLayer().fields().field('profiles').editorWidgetSetup().type()
    

    Select the Spectral Profile widget type and save the style to set the editor widget id to SpectralProfile

    Background:

    A Spectral Library is a QgsVectorLayer with at least one field where

    1. field type is binary (QVariant.ByteArray)
    2. field editory widget id is “SpectralProfile” (defined in EDITOR_WIDGET_REGISTRY_KEY enmapbox.externals.qps.speclib.__init__.py)

    In addition to this the SpectralLibraryUtils / SpectralLibrary assume that a binary field should be used as SpectralProfile field if the editor widget type id not set (= empty string)

  2. Log in to comment