3

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
  • 1
    are you able to identify the towns you want to label with an attribute? Commented Jul 26, 2017 at 13:13
  • I have a list of towns that I'd like labeled. I could probably add some sort of attribute from there?
    – Evan
    Commented Jul 26, 2017 at 13:18

2 Answers 2

4

You can do this easily in QGIS, what you need to do is use Rule-Based Labeling.

enter image description here 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.

2
  • I guess my difficulty is in how to specifically define the filter.
    – Evan
    Commented 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
1

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'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.