Bug report #10995
Virtual fields: graduated symbology with natural breaks does not use correct limits
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||19338|
- pick a polygon layer
- add a virtual field for area (two decimal places), like $area/10000 to get it in HA
- clone the resulting column in a "real" column
now test the virtual field and the real column to make a graduated symbology using natural breaks: the ranges for the "real" field make sense while the ones for the virtual field seems wrong.
#1 Updated by Giovanni Manghi over 6 years ago
maybe because this issue, maybe because it seems that when doing symbology the decimals of the virtual field are ignored (it seems to use always the maximum number of decimals regardless the choice that was made when creating the field), I'm noticing that when doing graduated symbology based on VF (testing polygons and $area function) then sometimes there are features that do not render... but if you toggle editing then they render...
#3 Updated by Giovanni Manghi over 6 years ago
Matthias Kuhn wrote:
I do not understand the bug report
- pick a polygon layer and compute the $area of polygons in a field and a virtual field with 2 decimals
- then do the graduated symbology using those fields, with natural breaks option
- with the "real" field the classes are like
221832.3600 - 280204.1300
280204.1300 - 430749.4500
430749.4500 - 553529.0200
the graduated renderer always shows 4 decimals, but anyway the values are correct -> the ones in the "real" column
- with the Virtual field the classes (natural breaks) are like
221832.3558 - 280204.1329
280204.1329 - 430749.4541
430749.4541 - 553529.0204
that is not correct because those are not the values that are in the column used for the symbology.
#7 Updated by Giovanni Manghi over 6 years ago
Matthias Kuhn wrote:
Could you test https://github.com/qgis/QGIS/pull/1535 to see if it fixes this problem?
Hi Matthias, thanks for the patch!
I will not be able to test it in the next weeks... I will give it a try as soon as I can, if anyone hasn't looked at it before. Cheers!