-
assigned issue to
when setting speclib binary field to SpectralProfile, changes are not persistent after restart
Benjamin, the animated gif is to big for uploading it here. Use this link here:
https://drive.google.com/file/d/1sERRWZn3C_sVmv0FJv448IunY133fT0P/view?usp=sharing
Comments (17)
-
reporter -
Please describe the steps to reproduce this behavior (even better provide some code).
-
reporter It says it in the description, just click on the link to get an animated GIF
-
reporter even better provide some code
Not sure if this bug is related to your API. I would guess it is rather a GUI issue.
-
Sorry, but your issue description misses basic details to get reproduced.
From its title only it does not become clear in which context which speclib is opened and which field is set to “SpectralProfile” and so on.Good and detailed issue description allow others (users, developers, search engines) to find issue based on keyword and to compare it to their own use-case. This way the issue tracker becomes a library of cases, solutions and discussions and helps to improve software like the EnMAP-Box. Just putting everything into a “video” even too large to be uploaded here contradicts this idea.
-
reporter it does not become clear in which context which speclib is openedÂ
You are right, from the video alone, it is not clear, which file I used. It’s from the repo: enmap-box/tests/testdata/library.gpkg
‌
Good and detailed issue description allow others (users, developers, search engines) to find issue based on keyword and to compare it to their own use-case. This way the issue tracker becomes a library of cases, solutions and discussions and helps to improve software like the EnMAP-Box. Just putting everything into a “video” even too large to be uploaded here contradicts this idea.
I found it hard to put the several steps shown in the video into self-explaining words. Now that the filename of the library is clear, everything else should be perfectly clear viewing the video. But anyway, here are the instructions in written word:
- drag&drop the library onto the gray view area
- set AutoForm of “profiles” field to SpectralProfile
- save current style as default style
- close the box
- start the box again
- drag&drop the library onto the gray view area
- look at the AutoForm of the “profiles“ field → not showing SpectralProfile (that is the issue)
Hope that helps.
-
- changed status to open
-
I don’t know why the style is not loaded initially, but you can use “Restore Default” to get it.
-
reporter The thing is, when saving the style via QGIS, the EnMAP-Box is showing it correctly right away. E.g. for enmapbox/exampledata/library_berlin.gpkg
- Could it be, that the EnMAP-Box saves the default style slightly different compared to QGIS?
- Possible workaround: when adding a new vector layer from a given filename (layer = QgsVectorLayer(filename)), you could call layer.loadDefaultStyle() afterwards
‌
-
loadDefaultStyle should be already called when creating a QgsVectorLayer with default layer options,
same with QgsVectorLayer.saveDefaultStyle(), and the QML looks correct.Really strange….
-
QGIS seems to be affected by the same behaviour and also for standard widget types, like the range widget:
Standard loading gives me:I have to call Style → Restore Default to get the right range properties (and the Spectral Profile widget for field “profiles”)
‌
-
reporter loadDefaultStyle should be already called when creating a QgsVectorLayer with default layer options,
Have you tried to call layer.loadDefasultStyle explicitely?
-
reporter QGIS seems to be affected by the same behaviour and also for standard widget types, like the range widget:
Ah ok, so maybe more a QGIS Bug.
-
It definitely is. QgsVectorLayer.saveAsDefaultStyle() writen an QML that described the edit widget type, e.g. for range as:
<field configurationFlags="None" name="number"> <editWidget type="range"> <config> <Option type="Map"> <Option value="false" name="AllowNull" type="bool"/> <Option value="256" name="Max" type="int"/> <Option value="1" name="Min" type="int"/> <Option value="4" name="Precision" type="int"/> <Option value="1" name="Step" type="int"/> <Option value="SpinBox" name="Style" type="QString"/> </Option> </config> </editWidget> </field>
Otherwise the layer properties dialog generates something like:
<field configurationFlags="None" name="number"> <editWidget type="Range"> <config> <Option type="Map"> <Option value="false" name="AllowNull" type="bool"/> <Option value="256" name="Max" type="int"/> <Option value="1" name="Min" type="int"/> <Option value="4" name="Precision" type="int"/> <Option value="1" name="Step" type="int"/> <Option value="SpinBox" name="Style" type="QString"/> </Option> </config> </editWidget> </field>
Note the difference: “Range” - this should be the display name only and “range”, the identifier for the widget. Somewhere the display name is taken instead of the widget id.
-
addresses #726 (workaround) holds #726 (needs to be fixed in QGIS)
Signed-off-by: Benjamin Jakimow benjamin.jakimow@geo.hu-berlin.de benjamin.jakimow@geo.hu-berlin.de
→ <<cset 3ed39df441d1>>
-
- changed status to on hold
addresses #726 (workaround) holds #726 (needs to be fixed in QGIS)
Signed-off-by: Benjamin Jakimow benjamin.jakimow@geo.hu-berlin.de benjamin.jakimow@geo.hu-berlin.de
→ <<cset 3ed39df441d1>>
-
reporter - changed component to known issue
- Log in to comment