- attached library.gpkg
vector layer with binary field is not considered a valid spectral library anymore
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)
-
reporter -
reporter Use the attached file to reproduce the problem.
-
reporter -
assigned issue to
-
assigned issue to
-
addresses
#724SpectraLibrary default provider set to 'ogr'→ <<cset 1a62ebcac5da>>
-
addresses
#724added example to replicated behaviour in unittest→ <<cset cc8f7ec68b1c>>
-
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
- field type is binary (
QVariant.ByteArray
) - 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)
- field type is binary (
-
addresses
#724nd pyqtgraph Qt sip import→ <<cset 003ca2818949>>
-
reporter - changed status to resolved
-
reporter It is working fine now. Setting an editor widget is now optional, as it should be.
- Log in to comment