I'm trying to create a labeled heat-map of incidents. Currently, I can label every town in the state -- which clutters up my map -- or I can have no labels at all. My boss would like me to instead label only the towns where we have an incident recorded. I've been trying to puzzle out a solution using conditional labeling, but I'm not very familiar with programming. I'm wondering if this is a) possible at all and b) if possible, how would I tell QGIS to only display the labels of certain towns?
2 Answers
You can do this easily in QGIS, what you need to do is use Rule-Based Labeling.
From Properties, choose Labels and then Rule-based labeling. In there you will need to define a rule. Choose the column you want to label with (name probably) and define the filter.
In the filter you can simply list down the cities you want to label (Not the best way) or you can use an attribute to identify the cities where an incident was reported and label them.
-
I guess my difficulty is in how to specifically define the filter.– EvanCommented Jul 26, 2017 at 13:59
-
Depends on how you identify the towns with an incident, you probably have an attribute related to the incidents, you could use that in your filter. Commented Jul 27, 2017 at 7:04
Select the town layer in your project. Turn on editing mode, add a text column to the attribute table called "Incident?" Now select all the towns you want labeled, and change the value in "Incident?" to 'yes'
Set up rule-based labeling on your Towns layer using this as the filter:
"Incident?" = 'yes'