Bug report #1397

continuous colour showing incorrect min/max values in legend

Added by Brent Wood about 16 years ago. Updated over 15 years ago.

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

Description

When opening a PostGIS table, the features intially plot fine. If I then choose continuous colour (symbology) & select the field to use to define the colours, the max value displayed in the LHS legend for the layer bears no resemblance to the actual values of the selected column, eg: 111.0000 is shown, but the dataset has values well into the thousands. Similarly, the min value shown in the legend is 0.00000, but the attribute table, sorted on the column, shows a minimum of 2.1

The correct values are shown in the attribute table, and if classification ranges are used instead of continuous colour, the correct numbers are shown in the legend.

As far as I can tell from looking at the map canvas, the colours are assigned appropriately, just the legend is incorrect, but I cannot confirm this.

History

#1 Updated by Brent Wood about 16 years ago

When opening a PostGIS table, the features intially plot fine. If I then choose continuous colour (symbology) & select the field to use to define the colours, the max value displayed in the LHS legend for the layer bears no resemblance to the actual values of the selected column, eg: 111.0000 is shown, but the dataset has values well into the thousands. Similarly, the min value shown in the legend is 0.00000, but the attribute table, sorted on the column, shows a minimum of 2.1

The values shown, and the assigned colours are in fact from another column than the selected one, the prvious numeric column in the table.

The correct values are shown in the attribute table, and if classification ranges are used instead of continuous colour, the correct numbers for the selected column are shown in the legend.

#2 Updated by nbest - almost 16 years ago

I have also seen this on OS X and Ubuntu Intrepid. There also seems to be a problem with the drop down that selects which column is to be rendered in that not all of the columns from the attribute table are available and the values displayed for the legend do not correspond to the selected field, perhaps an index-off-by-one situation. When I ogr2ogr my data to a shapefile, everything works fine, except of course that I can't use the query builder but rather rely on ogr2ogr -where to extract the subsets.

#3 Updated by Marco Hugentobler over 15 years ago

Only the columns of type int or double are available in continuous color classification (not possible e.g. with string types of course).

The off by one bug: is this still true in current svn version?

Regards,
Marco

#4 Updated by Giovanni Manghi over 15 years ago

I made a few testes with QGIS 1.2 (rev. 11005, ubuntu 9.04) with both postgis and shapefile layers, and it shows correct min/max values.

The only thing I notice is that if the value is a decimal number, in the legend is shown with a precision that the value in the attribute table doesn't have. Ex.

542.894 --> 542.894000

Please check again with the latest version under your platform, if the bug is solved we can close this.

#5 Updated by Marco Hugentobler over 15 years ago

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

Fixed in dff79102 (SVN r11017)

Also available in: Atom PDF