Bug report #983

"Graduated Symbol" symbology: wrong numeric ranges

Added by Maciej Sieczka - over 12 years ago. Updated over 11 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Symbology
Affected QGIS version: Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:11042

Description

There are following values in the numeric column of a vector layer: 0, 1, 2, 3.

Go to Layer Properties > Symbology > Graduated Symbol to build a legend for it.

If the number of classes is 1, QGIS creates the range as "0.999 - 3.001". Why is 0 omitted and why is max grater than 3? The range should be "0 - 3".

For 2 classes I get: "0.999 - 2.000" and "2.000 - 3.001". Besides wrong min and max like above, I think that "2.000" should not be included in both ranges. Moreover, as the input are integer numbers, decimal numbers should not be present - they suggest different numeric precision than the input data actually have.

nmb.tar.bz2 - example Shapefile to reproduce the bug (729 Bytes) Maciej Sieczka -, 2008-03-28 03:22 PM

History

#1 Updated by Jürgen Fischer over 12 years ago

what data source does this apply to?

#2 Updated by Maciej Sieczka - over 12 years ago

Replying to [comment:1 jef]:

what data source does this apply to?

I tried PostGIS and Shapefile - the bug applies to both.

Check with the attached Shapefile first, then after importing it into PostGIS (thanks for fixing SPIT!!!). You should be a ble to reproduce the bug with either data source.

#3 Updated by Tim Sutton about 12 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed

Tested in SVN trunk f5a0a4ca (SVN r9471) and graduations run from -0.001 to +4.001. Works for me, I'm closing this ticket, please reopen if problems persist.

#4 Updated by Maciej Sieczka - almost 12 years ago

  • Status changed from Closed to Feedback
  • Resolution deleted (fixed)

This bug is only partialy fixed.

The attached Shapefile has the following values in the floating point column 'nmb': 0.0, 1.0, 2.0, 3.0.

Try to classify it with "graduated symbol", one class - the data range according to QGIS is '-0.001 - 4.001'. This exceeds the actual data range which is '0 - 4'.

#5 Updated by Giovanni Manghi over 11 years ago

Tested now on QGIS 1.2 (rev. 10988) with the provided shapefile (one column, "nmb", with values 0,1,2,3,4).

with 1 classes and "mode" is "quantiles" qgis creates the range "0.000000 - 4.000000"

with 1 classes and "mode" is "equal interval" qgis creates the range "-0.001 - 4.001"

with 2 classes and "mode" is "quantiles" qgis creates the ranges "0.000000 - 2.000000" and "2.000000 - 4.000000"

with 2 classes and "mode" is "equal interval" qgis creates the ranges "-0.001 - 2.000" and "2.000 - 4.001"

I'm not sure the problem has been solved.

#6 Updated by Marco Hugentobler over 11 years ago

  • Resolution set to fixed
  • Status changed from Feedback to Closed

Fixed in 6a9ae8f4 (SVN r10990)

Also available in: Atom PDF