10

This question already has an answer here:

There are a bunch of questions here related to labeling in QGIS, but it's not clear which version they are referring to, and I know this is something that has changed recently. Hopefully it makes sense to start a new question due to the new labeling functionality.

I'm trying to label a road network so that every street is labelled. I have the 'auto' labeling doing a decent job, but it is not placing a label on every street. How can I (with the minimum of effort) keep the existing auto-placed labels (possibly with a few tweaks/manual moves,) but then also go in and manual 'force' missing labels to appear, and position them myself and/or change font size to make them fit?

The new label tools in the toolbar are not very easy to figure out, and the 'pinning' concept is lost on me. Can anyone explain the steps?

marked as duplicate by PolyGeo Jul 7 '17 at 0:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Wanted to add an update, in case it is helpful. I had great success yesterday with the directions previously offered, but then ran into trouble after joining my shapefile with labels to another (CSV) file. Once the two files were joined, the labels would no longer move, despite the x, y columns designated to hold the label position coordinates. If anyone needs to join data to a table they wish to label, I would suggest doing this first and then exporting to a new shapefile before proceeding with the labeling. – bwilkes Aug 4 '15 at 14:51
15

To see all the labels you should in 'Layer labelling settings' go to 'Rendering' tab and check "Show all labels for this layer (including colliding labels)". To manually adjust label position you should make layer editable, add two columns: for X and for Y coordinate of the labels. Then go back to 'Layer labelling settings'and go to 'Placement' tab and find "Data defined" set of options and choose fields for X and Y as shown on screenshot:

enter image description here

Now when the layer is editable a 'Move label button' will be available and you will be able to move any label. New changed coordinates will be stored in the fields you provided.

  • 1
    Great! I had all of that figured out already, but couldn't figure out the 'pinning' concept. It turns out that when you manually modify a label, it is 'pinned' and then you can modify it as SS_Rebelious says. The only part I don't understand is the "Show/Hide" labels tool, which I cannot get to activate. Perhaps because I already specified "Show all labels"? – Darren Cope Jul 31 '13 at 17:19
  • @DarrenCope, "show all labels" has nothing to do with it. Honestly, I don't know how to make that button active too. – SS_Rebelious Jul 31 '13 at 17:26
  • 1
    Actually, I just figured it out. You must have a column set so that the "Show Label" option is data defined. Integer seems to work fine, with 1 meaning visible, and 0 meaning hidden. – Darren Cope Jul 31 '13 at 17:45
12

I've spent a bit more time with this, and think I have it more-or-less figured out. Here's what the new tools do, to the best of my knowledge (for those with more expertise, please feel free to comment or correct as necessary):

  • Layer Labeling Options: Brings up the options menu. This is the same as right-clicking on the layer and choosing Properties, Labels
  • Highlight Pinned Labels: Shows or hides a shaded 'outline' box around the labels that have been manually moved. Highlight is cyan when layer is not editable, and green when editable.
  • Pin/Unpin Labels: Changes a label from 'auto' label settings to manual label settings. This will remove all rotation, and change the position of the label. You must then manually set this using the move and rotate tools. Note: Layer must be editable for this tool to be active.
  • Show/Hide Labels: Displays (Click) or hides (Shift-Click) the label for the feature you click. Note: Layer must be editable for this tool to be active. Note 2: Layer must have a data defined column set for visibility for this tool to be active. To do this, create an integer column (named "visibility' for example), and assign it in the label properties under Rendering > Show Label > YourColumnName
  • Move Label: Allows you to change the position of the label. Changing the position will "Pin" the label as well. This will remove all rotation, and change the position of the label. Note: Layer must be editable for this tool to be active. Note 2: Layer must have a data defined column set for x and y position for this tool to be active. To do this, create 2 'double' (aka decimal or real) columns (named "LabelX" and "LabelY" for example), and assign them in the label properties under Placement > Data Defined > X and Y
  • Rotate Label: Allows you to change the rotation of the label. You must first "Pin" the label before you can rotate it. Note: Layer must be editable for this tool to be active. Note 2: Layer must have a data defined column set for Rotation for this tool to be active. To do this, create a 'double' (aka decimal or real) column (named "Rotation" for example), and assign it in the label properties under Placement > Data Defined > Rotation
  • Change Label: Brings up additional options to change the particular label you clicked. Here you can set things such as the specific font/size/colour, buffers, etc. These all need to have their own columns defined, and the label properties set to use them as 'data defined' fields.

I should note that the labeling functionality seems to be changing rapidly, so this currently applies to QGIS 1.9.0-Master. I hope it all makes sense! With a bit of time spent figuring it out, it's really quite powerful!

  • Thank you for providing the information (these tools are currently undocumented). However, there are a couple of changes to your description. Where you mention 'This will remove all rotation,' this only applies to instances where you have 'Preserve data rotation values' checked, which will use preexisting rotation values. Otherwise, the current rotation of a pinned label will be written to the mapped attribute field. Also, depending upon the placement, you can data define a rotation independent of pinning, e.g. 'Offset from point' accepts a rotation and can be manipulated with Rotate Label. – dakcarto Aug 2 '13 at 20:38

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