Bug report #16917

Vector layer dialog orders numeric columns alphabetically, not numerically

Added by Johannes Kroeger almost 3 years ago. Updated almost 3 years ago.

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

Description

If you open a vector file with multiple layers you get the "Select vector layers to add..." dialog.
That dialog includes a column "Number of features" with counts of the features per layer.
If you sort that column, it will be sorted alphabetically (1, 10, 100, 2, 3) but it should be sorted numerically. See the attached screenshot.
The same applies to the Layer ID column.

Confirmed by duiv in master, I am on 2.18.

You can use the attached sample gpkg to reproduce.

Source for the sample data was http://suche.transparenz.hamburg.de/dataset/alkis-verwaltungsgrenzen-hamburg7
License of the sample data: Datenlizenz Deutschland Namensnennung 2.0 (Freie und Hansestadt Hamburg, Landesbetrieb Geoinformation und Vermessung)

ALKISVerwaltungsgrenzen_HH_2016-11-02.gpkg.gz (1.66 MB) Johannes Kroeger, 2017-07-22 12:54 PM

feature count order.png (8.37 KB) Johannes Kroeger, 2017-07-22 12:57 PM

nl.gpkg - some sample data showing it too (648 KB) Richard Duivenvoorde, 2017-07-22 01:01 PM

sort.png - sorting problem (21.9 KB) Richard Duivenvoorde, 2017-07-22 01:02 PM

Associated revisions

Revision 90fa6c2e
Added by Jürgen Fischer almost 3 years ago

sub layer dialog: sort by layer id and feature count numerically (fixes #16917)

History

#1 Updated by Richard Duivenvoorde almost 3 years ago

confirmed in master with both attached datasets

#2 Updated by Jürgen Fischer almost 3 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF