[Qgis-user] labelling by attribute
Tom Lennon
tolennon at gmail.com
Fri Jun 19 18:20:05 PDT 2015
Hi Lucas:
You can use the "data defined override" to set the text size based on your
classes.
Use the fancy "E" under Layer Properties > labels > size.
The program expects a number which will become the size.
If the class in your data base is called "class" and it happens to be a
number usable as the text size just put "class" in the override.
If "class" is a ranking number ( like 1 - 6, with 1 being the largest
population and 6 the least) then enter 13 - "class" in the override to get
7 for least and 12 for largest "class".
if "class" is a population number then enter a CASE expression like this:
CASE
WHEN "class" > 1000000 THEN 12
WHEN "class" > 750000 AND "class" < 1000000 THEN 11
WHEN "class" > 500000 AND "class" < 750000 THEN 10
WHEN "class" > 250000 AND "class" < 500000 THEN 9
WHEN "class" > 100000 AND "class" < 250000 THEN 8
ELSE 7
END
The overrides can be used to also change font or type style based on data
values as well.
On Fri, Jun 19, 2015 at 5:52 PM, Fred Lali <lalifred at gmail.com> wrote:
> Lucas, just copy the same layer and paste in the same canvas n the label
> them with different fonts!
>
>
>
> For God and My Country
> Consultant in: GIS,Forestry and Environment @ Earth Consult(U) Ltd.
> CCRP GIS Support-Uganda
> (The MCKNIGHT Foundation)
>
> Rotarian at RC. Bweyogerere Namboole
> Mob: 0772/0752-841118
> Sent from Lumia Windows phone
> ------------------------------
> From: Luca Galuppini <luca.galuppini at gmail.com>
> Sent: 20/06/2015 00:28
> To: qgis-user at lists.osgeo.org
> Subject: [Qgis-user] labelling by attribute
>
> 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...
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
--
tolennon at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150619/05e26c14/attachment.html>
More information about the Qgis-user
mailing list