Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual fields: graduated symbology with natural breaks does not use correct limits #19338

Closed
qgib opened this issue Jul 31, 2014 · 8 comments
Closed
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers

Comments

@qgib
Copy link
Contributor

qgib commented Jul 31, 2014

Author Name: Giovanni Manghi (@gioman)
Original Redmine Issue: 10995
Affected QGIS version: master
Redmine category:virtual_fields


Steps:

  • 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.


Related issue(s): #19342 (relates)
Redmine related issue(s): 11000


@qgib
Copy link
Contributor Author

qgib commented Aug 1, 2014

Author Name: Giovanni Manghi (@gioman)


NOTE:
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...

@qgib
Copy link
Contributor Author

qgib commented Aug 3, 2014

Author Name: Matthias Kuhn (@m-kuhn)


I do not understand the bug report, but I think it is related to #19342 like #19336.

@qgib
Copy link
Contributor Author

qgib commented Aug 5, 2014

Author Name: Giovanni Manghi (@gioman)


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.

@qgib
Copy link
Contributor Author

qgib commented Aug 5, 2014

Author Name: Matthias Kuhn (@m-kuhn)


Thank you for the clarification.

So it is indeed the same problem that the precision is not taken into account when evaluating the expression. If #19342 is solved, this issue should neither show up any longer.

@qgib
Copy link
Contributor Author

qgib commented Aug 5, 2014

Author Name: Paolo Cavallini (@pcav)


  • subject was changed from Virtual fields: graudated symbology with natural breaks does not use correct limits to Virtual fields: graduated symbology with natural breaks does not use correct limits

@qgib
Copy link
Contributor Author

qgib commented Aug 13, 2014

Author Name: Matthias Kuhn (@m-kuhn)


Hi Giovanni,

Could you test #1535 to see if it fixes this problem?

@qgib
Copy link
Contributor Author

qgib commented Aug 13, 2014

Author Name: Giovanni Manghi (@gioman)


Matthias Kuhn wrote:

Hi Giovanni,

Could you test #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!

@qgib
Copy link
Contributor Author

qgib commented Oct 5, 2014

Author Name: Matthias Kuhn (@m-kuhn)


Fixed in changeset "7318c73012a2c7245f5ac7a268a457ae84f0a4de".


  • status_id was changed from Open to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers labels May 25, 2019
@qgib qgib closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers
Projects
None yet
Development

No branches or pull requests

1 participant