[Qgis-user] labelling by attribute

Fernando M. Roxo da Motta petro at roxo.org
Fri Jun 19 18:05:55 PDT 2015


  Hi Luca,

  Go to the layer properties and define the Labels as you would do if
you don't need this kind of difference in size.  Next define a constant
size just defining if using a pixel size or layer units.   Just beside
the size number there is a button, just click on it and select the
"edit" option.  In the text canvas that will open use something like:

====================8<--------- clip here ----------------
case 
when  "cityimportance"   >1200 then 3500 
when  "cityimportance"  < 1200  AND  "cityimportance" > 500 then 1000
when  "cityimportance"  < 200  AND  "cityimportance" > 100 then 500
else    250 
end
====================8<--------- clip here ----------------

  Of course the "cityimportance" should be some layer attribute
and the example above should provide the test for some ranges.  The
number after the "then" or "else" clauses are the sizes, in the example
it is meant to be the area of some polygon layer I had in a map.  Just
adapt accordingly.

  Naturally you can use the same approach for any other characteristic
that shows that kind of button beside it.


  HTH


On Fri, 19 Jun 2015 23:28:35 +0200, Luca Galuppini
<luca.galuppini at gmail.com> wrote:


> i'm sorry for posting a lot of newbie questions but tutorials are not
> so clear about this:
> i have to label a point feature with different font size or style
> depending on an attribute in the table (for example, i have cities
> grouped in classes by their importance, and i want the bigger cities
> to have bigger label size).
> this is really straight forward in arcgis but i really can't find this
> option in qgis 2.8.2, at least not in a place when one can find it
> easily. i expect i should have something similar to symbol by
> category, but nothing like that is in the label menu...








  Roxo

-- 
---------------- Non luctari, ludare -------------------+ WYSIWYG
Fernando M. Roxo da Motta <petro at roxo.org>              | Editor?
Except where explicitly stated I speak on my own behalf.|  VI !!
      ( Usuário Linux registrado #39505 )               | I see text,
------------ Quis custodiet ipsos custodes?-------------+ I get text!
 



More information about the Qgis-user mailing list