[Qgis-developer] Shields for Labels

Martin Dobias wonder.sk at gmail.com
Mon Aug 8 06:54:27 EDT 2011


Hi Tim

On Sun, Aug 7, 2011 at 11:47 PM, Tim Sutton <lists at linfiniti.com> wrote:
> Hi Folks
>
> Is anyone else interested in being able to have shields for labels
> (e.g. to mark highways etc.). I've made an initial stab at it - you
> can see an example and git details in case you want to try it in the
> link below. Is there any interest in getting this into trunk? Maybe a
> better way of doing things? I thought of using SVG shields but I think
> it might be a performance killer if you have many labels and each
> needs scaling.
>
> http://linfiniti.com/2011/08/shield-labels-for-qgis/

Nice stuff. If you would like to reuse as much code as possible you
may use marker symbols from symbology-ng to render the shields - both
drawing and GUI would be for free to render SVGs, Font symbols etc.

As I understand labeling with shields, there are typically two cases:
1. short text (e.g. road names D1, E55) - fixed-size shields can be used
2. long text - variable-length background must be used to fit the
text. Usually something simple like rectangles (or rounded rects) are
used. I think some software supports also automatic horizontal scaling
of shields based on symbols, but the results may look weird.

If I am not completely mistaken about the use cases we could use a
combined approach of shields: the user would select either to use
rectangles that scale with text (like in your implementation) and/or
marker symbols (fixed size).

In future we could add uneven scaling of symbols, so these two options
would boil down to one mighty shield implementation ;-)

Btw. I hope that in future we will enhance the style manager so that
it will accomodate not only symbols and color ramps, but also other
assets like label styles and shield styles, so the user could
seamlessly use the favourite ones without having to recreate them all
over again.

Martin


More information about the Qgis-developer mailing list