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

Incorrect scale range legend after applying logarithmic graduated symbology to a vector layer #45454

Closed
2 tasks
Dr-Robert-Mason opened this issue Oct 7, 2021 · 2 comments · Fixed by #47259
Closed
2 tasks
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Symbology Related to vector layer symbology or renderers

Comments

@Dr-Robert-Mason
Copy link

Dr-Robert-Mason commented Oct 7, 2021

What is the bug or the crash?

Summary: This bug involves an incorrect lower bound being displayed beside the lowest class when logarithmically-scaled graduated symbols are applied to features in a vector layer.
Description: The layer type that this bug applies to is a shapefile in which features have one or more attribute(s) that are continuously valued. The bug occurs when one wishes to apply a colour scheme to the features that is based on a logarithmic scaling of the continuously-valued attribute. In the Symbology tab of the Layer Properties window, the colour scheme is applied by selecting "Graduated" in the top field, selecting the desired attribute to base the colour scheme on in the "Value" field, and then selecting "Logarithmic scale" in the "Mode" field, and selecting the desired number of classes in the "Classes" field. The symbols and the ranges of values in the corresponding data bins will then be automatically determined and will appear in the white space in the centre of the symbology tab. The bug is this: if, in the bin corresponding to the "lowest" symbol, there no features in the layer that actually fall within this bin, then the lower bound of the range of values for this symbol will be erroneously displayed on screen as being the value corresponding to the "least-valued" feature, even though this feature occurs in the bin corresponding to the "second lowest" symbol. When the symbology scheme is applied and the Layer Properties window is closed, the erroneous value range for the "lowest" symbol is then displayed in the drop-down legend beneath the layer in the Layers window, if this window is open.
This bug was picked up in QGIS 3.16.4-Hannover in August 2021.

Steps to reproduce the issue

To reproduce an example of this error:

  1. Open a blank qGIS project and add the attached vector layer using Layer > Add Layer > Add Vector Layer.
  2. Open the attributes table for this layer ("Heron 2015") and note that for the Attribute "Contributi" (final column), the lowest value is 0.0099.
  3. Open the Layer Properties window and go to the Symbology tab. Select "Graduated" in the top field. In the Value field select "Contributi". In the Mode field select "Logarithmic Scale" and in the Classes field select 4.
  4. Examine the ranges of values that have been allocated to the four symbols that appear as a list in the "Classes" tab in the centre of the Symbology tab. The "lowest" valued symbol has been "given" a corresponding range of 0.0099 (lower bound) to 10^(-2.5) (upper bound), that is 0.0099-0.003162. The lower bound for this symbol has been designated as being 0.0099, which is the lowest value of "Contributi" as we saw in the attributes table, despite the fact that this value clearly is greater than the upper bound of this symbol of 10^(-2.5), and actually falls within the range of 10^(-2.5) to 10^(-2) that has been allocated to the "second lowest" symbol.
  5. By returning to the attribute table, selecting the feature with the "Contributi" value of 0.0099, and examining the map, and then deselecting this feature and examining the map again along with the symbol legend, it can be seen that this feature has been coloured the correct symbol colour ("second lowest" symbol), even though it is also listed within the range corresponding to the "lowest" symbol. Therefore, the error seems to be only with the display of the range of values in the legend and Symbology tab.
    Heron_2015.zip

Versions

QGIS 3.16.4-Hannover

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

  • I tried with a new QGIS profile

Additional context

No response

@Dr-Robert-Mason Dr-Robert-Mason added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Oct 7, 2021
@gioman
Copy link
Contributor

gioman commented Oct 7, 2021

QGIS 3.16.4-Hannover

@Dr-Robert-Mason can you please check if it happens with the current release, 3.16.11 or 3.20.3, thanks.

@gioman gioman added the Feedback Waiting on the submitter for answers label Oct 7, 2021
@Dr-Robert-Mason
Copy link
Author

@gioman I have just checked 3.16.11 and can confirm that this bug does occur in that release

@gioman gioman added the Symbology Related to vector layer symbology or renderers label Oct 8, 2021
@gioman gioman changed the title Incorrect scale range after applying symbology to a vector layer Incorrect scale range legend after applying logarithmic graduated symbology to a vector layer Oct 8, 2021
@gioman gioman removed the Feedback Waiting on the submitter for answers label Oct 8, 2021
elpaso added a commit to elpaso/QGIS that referenced this issue Feb 8, 2022
elpaso added a commit to elpaso/QGIS that referenced this issue Feb 9, 2022
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! Symbology Related to vector layer symbology or renderers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants