Bug report #11718

When adding manually a categorized symbology class this is not ordered correctly when clicking on "value"

Added by jeremy spurway about 10 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Symbology
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:19956

Description

new description:

  • open a vector
  • make a categorized symbology using a interger/double column
  • clicking on the "value" column you can order the classes as expected, desc/asc because are numbers
  • manually delete one class
  • add a new class and give it the value of the previously deleted one
  • now when clicking "value" the new class takes and unpredictable position, and not anyway the expected one

old description:
Hi,

it seems that the 'categorized' style builder assumes that column for styling data contains string values.

When the symbol classification is sorted by the Value column, string ordering is applied, not numeric.

For instance, integer categories 0-15 are ordered like: 0, 1, 10, 11, 12, 13, 14, 15, 2, 3, 4, 5, 6, 7, 8, 9.

This makes it difficult to extend the range manually.

Is it possible to detect the data type and order appropriately?

best wishes - JS

nn60_OST50CONT_20130612.zip - OS terrain contours (345 KB) jeremy spurway, 2014-11-24 08:10 AM

licence.txt Magnifier - OS license (192 Bytes) jeremy spurway, 2014-11-24 08:10 AM

sim1.png (62.8 KB) Giovanni Manghi, 2014-11-24 12:31 PM

sim2.png (66.2 KB) Giovanni Manghi, 2014-11-24 12:31 PM

QGIS_vecStyCat_1.png - before sort (35.4 KB) jeremy spurway, 2014-11-24 01:31 PM

QGIS_vecStyCat_2.png - after sort (35.3 KB) jeremy spurway, 2014-11-24 01:31 PM

QGIS_vecStyCat_4.png (36.9 KB) jeremy spurway, 2014-11-24 02:04 PM

QGIS_vecStyCat_3.png (36.6 KB) jeremy spurway, 2014-11-24 02:04 PM

QGIS_vecStyCat_5.png (36.9 KB) jeremy spurway, 2014-11-24 02:04 PM

QGIS_vecStyCat_6.png (36.6 KB) jeremy spurway, 2014-11-24 02:04 PM

History

#1 Updated by jeremy spurway about 10 years ago

PS.
I forgot to add, I'm using QGIS 2.4.0

#2 Updated by Giovanni Manghi about 10 years ago

  • Status changed from Open to Feedback
  • Category set to Symbology

it does not seems to be an issue on qgis 2.6, please try and report back.

#3 Updated by jeremy spurway about 10 years ago

Hi,
the same issue exists in 2.6; my categorisation column is a 'double' field, and produces a sorted 'Value' list like:
"... 170, 180, 190, 20, 200, 210..."
JS

#4 Updated by Giovanni Manghi about 10 years ago

jeremy spurway wrote:

Hi,
the same issue exists in 2.6; my categorisation column is a 'double' field, and produces a sorted 'Value' list like:
"... 170, 180, 190, 20, 200, 210..."
JS

what datasource do you use? I tested shapes and cannot replicate.

#5 Updated by jeremy spurway about 10 years ago

ESRI shp line; as attached.

#6 Updated by Giovanni Manghi about 10 years ago

jeremy spurway wrote:

ESRI shp line; as attached.

see attached images

#7 Updated by jeremy spurway about 10 years ago

what happens if you click the 'Value' column to (re)order the data?
see attachments for what happens on my installation

#8 Updated by Giovanni Manghi about 10 years ago

jeremy spurway wrote:

what happens if you click the 'Value' column to (re)order the data?
see attachments for what happens on my installation

if I click on "value" I still get the right order (asc or desc) if I click "legend" it orders it as text, because the legend is text.

#9 Updated by jeremy spurway about 10 years ago

what happens if you add a new category, value =10, then order by value?
for me, it doesn't order numerically.
I tried creating a new layer, for a different shape file, and added a new value (=50).
Each time I click 'Value' column header, the '50' category ends up somewhere different - see attached.

#10 Updated by Giovanni Manghi about 10 years ago

  • Status changed from Feedback to Open
  • Tracker changed from Feature request to Bug report
  • Subject changed from vector style categorized does not detect numeric column to sort Values to When adding manually a categorized symbology class this is not ordered correctly when clicking on "value"
  • Affected QGIS version set to master
  • Crashes QGIS or corrupts data set to No

#11 Updated by Giovanni Manghi over 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#12 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Open to Closed
  • Resolution set to end of life

Also available in: Atom PDF