qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.29k stars 2.96k forks source link

Sort Categorized Renderer by column in layer #51006

Open chleidersdorff opened 1 year ago

chleidersdorff commented 1 year ago

Feature description

Sometimes it would be nice to have a simple way to sort a catagorized renderer by a different column in the layer. This would be especially important when dealing with geology that has values that go from youngest to oldest in the legend but they are not named in alphabetical order. In addition this could be accomplished if it was possible to have a different filed in the layer used as a description (Legend) for the feature.

There are workarounds that involve making a sorted table with RGB values and using python to apply the catagorized renderer. See this post for details: https://gis.stackexchange.com/questions/371465/use-colums-in-attribute-table-to-set-colors-and-line-thickness-directly-automati

it would be nice if you could do this dynamically within the catagorized renderer of QGIS.

Additional context

image

nicogodet commented 1 year ago

Have you look trough rendering order option ?

https://docs.qgis.org/3.28/en/docs/user_manual/working_with_vector/vector_properties.html#layer-rendering

chleidersdorff commented 1 year ago

Hi @nicogodet, yes have tried that and besides it would not work if you have an existing styled categorised renderer, the order is always controlled by the Values used by the categorised renderer. Sometimes you might have a key used as the values, but would like the categories in a different order e.g. date or stratigraphic sequence as used in geology. It would also be nice to be able to sort an existing list of styled categories. I have some state geology features I download and they already have the correct styling but the categorized renderer is in alphabetical order. If I want to use them in maps I then need to manually order them. it would be good to have the ability to order them by geological sequence (in a different column)