4

[Edit : working with Quantum GIS version 2.0.1-Dufour]

I wonder if it is possible to use some field to set the symbology and some other to label the map.

[Edit 1 : I mean labeling the legend in the map designer tool to output as JPG or PDF, not labeling objects in the canvas for working purpose.]

[Edit 2 : The purpose of my question is to get an automatical process so I could save time and not manually change all the labels of the legend.]

My problem is : I have to make a map of natural habitats, based on european "CORINE biotopes" typology which uses entities with number and names, e.g. :

"37 hygrophilous meadows", "38 mesophilous meadows", "41 deciduous forests", "42 coniferous forests", "51 active bogs", etc.

So I would like to use shemes of the same color for habitats which are similar : all meadows in different tons of yellow, all forest in different tons of green, mires and bogs in some brown scale etc.

To do this I need to base my styling work on the NUMBERS, since following numbers identify similar habitats (meadows are 3X, forests are 4X, etc).

But for reading and understanding purpose, the printed map should be labelled with the NAMES. And the labelling should not get "noised" by the numbers, so I separated NAMES and NUMBER of the same entities in 2 different fields.

Is there some way to say QGIS to let me do the symbology on the basis of the "NUMBER"-field, but then to label the map on the basis of the "NAME"-field ?

I would like to set the "label" (like here from the Layer > Properties > Symbology) Layer - Properties - Symbology

To set the label of the legend in the Map Designer Tool : Here I would like to get the names of the habitats, and not the numbers. Map designer - Legend

Thanks for all kind of help.

8
  • version will determine a clear answer for you. can you tell us if your project is in 1.8 or 1.9?
    – Brad Nesom
    Oct 24, 2013 at 15:42
  • I just edited my post to give the version at the beginning of the question.
    – flo64
    Oct 24, 2013 at 15:47
  • I just edited my title to make it more specific. Sorry for the mistake interpretation and thanks for the provided help.
    – flo64
    Oct 24, 2013 at 16:06
  • Ok I think it is easier than we thought. in the layout, go to the area that says subgroup. and click on the blank area next to the numeric value. type into that spot. I don't know of an automated way to do that. unless you create a coded domain and use it on that field. not sure what the data source type is or if qgis supports that.
    – Brad Nesom
    Oct 24, 2013 at 17:18
  • Ok am i missing something here. in your layer properties do you have the names of the habitats? If so, add the layer twice, classify it by the numbers first, classify the other layer by the habitat name and then only display one in your legend. you will need to manually change the colour of each to match with the numbers. is the data available to download and i could look at it
    – Ger
    Oct 25, 2013 at 8:45

2 Answers 2

1

I think it is a basic display function.

Basically you open your layer. properties.

Click style, change from single symble to categorized and then click the selected field and classify.

then using the lable function just lable under the other field.

Didnt put pics but can if you want.

EDIT:

Based on the comment below i would, as always take the easy way. Just add the layer twice, one on top of the other, the base one classified in the way you want you legend to appear, the top one, the display, in the way you want you display classified. remove one out of the legend.

perhaps i miss again

4
  • Hi there, thanks for the answer. I think I was not exact enough in my question. I just edited it to specify that I am willing to label the legend in the map designer tool, not only in the working canvas, for which, yes your answer is the obvious solution.
    – flo64
    Oct 24, 2013 at 15:48
  • See my edit again there in my answer
    – Ger
    Oct 24, 2013 at 15:59
  • Yes it is more likely to do it. Thanks. I didn't think it was a way to do it. But it should. Only I would have to superpose also to legend one "blank" with the color sheme and no label, the other with transparent color and the labels ... I'll try it.
    – flo64
    Oct 24, 2013 at 16:09
  • Ok, it does work but I have to manually change all name from the colored legend to set each to one space (empty is not suitable and is automatically set back to the original values) then I have to put another legend in the top of the first (setting the background parameter to transparent). Then I have to set my labels in the correct order to make them correspond to the relevant color. So it does provide some help, but it is not suitable when the legend will have many values in it. Thanks anyway.
    – flo64
    Oct 24, 2013 at 16:17
0

Here is an example from 1.8
first add your layer. select the properties.
go to the style tab.
symbol

Here I have use the graduated but you probably will use the categorized

Then go to the Labels tab and select your field that you wish to label with.
enter image description here

3
  • Is that not what i said. and he said no.
    – Ger
    Oct 24, 2013 at 15:56
  • 1
    yes, it is the same Gerald already said. I'm so sorry, I just added pictures to help you understand which functions I mean. Thank you very much for your help anyway.
    – flo64
    Oct 24, 2013 at 16:02
  • No No. Sorry. Pictures say 1000 words and all that.
    – Ger
    Oct 25, 2013 at 8:06

Your Answer

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

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