5

QGIS has now few really good options for custom labels but I can't find a way how to easily manage labels along polylines.

Is there a tool which helps me place labels by clicking on a polyline so the label will be anchored to that point on line - to automatically set position above/on the line and proper rotation or even better curved with the line?

Similarly with polygon - click on polygon to exact spot where I want the label to be.

I know there is a workaround to create columns for labels x/y/rotation and move and rotate labels manually but that is often very time consuming and a clunky way compared to some other GIS software.

  • If not for using x/y/rotation columns in your layer's attribute table, how else would the label's location, or proximity to the proposed anchor point, be stored? BTW, anchor points for labels are not yet implemented, but have been discussed. – dakcarto Jul 23 '14 at 0:51
  • 1
    @dakcarto x/y/rotation columns are ok as far as it can be saved in joined table and I don't have to alter data table. The major idea is I am missing some tool which by clicking on the line generates x/y/rotation based on line feature. Otherwise I am spending extensive time going through table to make only needed labels visible and shifting them and rotate it manually many times to get some acceptable result. – Miro Jul 23 '14 at 23:14
4

So far the only way that works for me for polylines is split them two times around a place I want label in - into 3 parts - and set only middle part with visible label.

enter image description here

For polygons and points I am using EasyCustomLabeling ( http://plugins.qgis.org/plugins/EasyCustomLabeling/ ) which works great, creates memory layer which also can be saved as shapefile together with qml style to be able to use labels in multiple projects.

  • That's awesome, glad you found something that works a little to what you're looking for! – Joseph Jun 4 '15 at 9:08
  • Alternatively if you want to keep your polylines intact you could create a second layer which shows only the labels (and not the lines themselves)? In that way you can dictate exactly where you want the labels with the locations of your (invisible) lines. I use this technique with polygons where a single feature is spread out over a large area or is a complex shape, and I want to be able to show multiple labels for clarity. Works really well. – JimS-W Jul 26 '18 at 8:25
3

Although you mentioned labels, have you considered using Annotations? With these, you can simply point/click anywhere on the canvas and a marker will be set there. The drawback with this is you would have to manually type in whatever it is you wanted to label but it might be less trouble than getting all the labels in the right place. Just incase you do not know how to:

text annotation

Then point/click anywhere on the canvas:

Line with annotations

You do not need to save the annotations as a seperate file as it's automatically saved in the .prj project file. To show/hide the annotations, simple toggle the Annotation icon as shown above and press Ctrl + T.

Hope this helps.

  • Thank you for this suggestion, it might work for some cases but far from what I usually need - labels rotated sitting above / on / below line – Miro Jun 3 '15 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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