Opened 13 years ago

Last modified 13 years ago

#3226 reopened patch

Patch for showing number of features per class in legend

Reported by: mhugent Owned by: timlinux
Priority: minor: annoyance Milestone: Version 1.7.0
Component: GUI Version:
Keywords: Cc: mayeulk
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

Description

The following patch adds the capability of showing the number of features per class in the legend (updated after symbology change or attribute edit). To enable this feature, select the check box in the options dialog (general->show number of features in legend).

But I'm not sure if it is good to set that in the option or if it would be better to store it in the vectorlayer and expose through the vector property dialog. Because for large layers, it might take some time to update the feature count.

What do you think about it?

Attachments (1)

101118_qgis_featurecount.diff (18.9 KB ) - added by mhugent 13 years ago.

Download all attachments as: .zip

Change History (8)

by mhugent, 13 years ago

comment:1 by timlinux, 13 years ago

Hi Marco

I tested out your patch - cool addition! Yes I agree it is probably better to add as a general property of the layer - I tested with a large dataset and it seemed to spend a significant amount of time updating feature counts.

On a purely cosmetic level it might be nicer to put the counts in square brackets after the class name e.g.

[19]

Regards

Tim

comment:2 by mhugent, 13 years ago

Resolution: fixed
Status: newclosed

Thanks for your feedback. The patch is applied now in r14714. The feature count can be enabled per layer (right click menu of the legend layer).

comment:3 by mayeulk, 13 years ago

Resolution: fixed
Status: closedreopened

Hi, I had been waiting for this, thanks[[BR]]

Still it does not seem to work for rule-based rendering.

(I use the following type of rules:

tags like '%"place"="town"%'

on OSM data).

comment:4 by mayeulk, 13 years ago

It does not work either with simpler rules like:

place='town'

(if you have the town field)

comment:5 by pcav, 13 years ago

Component: Build/InstallGUI

Still true?

in reply to:  5 comment:6 by mayeulk, 13 years ago

Replying to pcav:

Still true?

Hi Paolo,

I just saw your question after opening bug #3737.

Yes, there is still this bug for rule-based rendering. (I'm not sure whether it's best to convert the patch into a bug or to open a new bug, please close one of the two if you wish).

Mayeul

comment:7 by mayeulk, 13 years ago

Cc: mayeulk added
Note: See TracTickets for help on using tickets.