Bug report #11863
invalid sld for graduated style on field with negative values
|Affected QGIS version:||2.6.1||Regression?:||No|
|Operating System:||Linux, Windows||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||20078|
When creating a graduated style on a field with negative values, the resulting sld file has the following xml:
The sld has a Literal within a Literal. Loading the same sld back into QGIS produces rules with || like:
value > '-' || 4.45316 AND value <= '-' || 0.786648
Which results in the same visualization for all negative fields.
Affects 2.4 to 2.6.1, probably also older versions. Tested on different layers, with different fields on Windows & Linux.
#1 Updated by Richard Duivenvoorde almost 5 years ago
- Target version set to Version 2.8.2
- Category changed from Symbology to Expressions
- File issue.zip added
I've been trying to debug this, and it appears that for the creation of the sld qgsexpression is used.
And after the parsing of an expression string like:
foo > -0.01 AND foo <= -0.001
the minus signs are seen/parsed as unary operators instead of a minus+doube
adding an example project so hopefully somebody more into this part of the code is able to debug/fix it better