7

I have a shapefile of cartographic text (roads, buildings, water etc.) and I would like to be able to rotate individual road names to fit within the width of the road.

Anyway, I know it is possible to rotate a feature in QGIS using the Advanced Digitizing Toolbar (Is there a Rotate Tool in QGIS?), however, when I use this feature it doesn't seem to rotate at all (St Nicholas Avenue, below).

enter image description here

What am I doing wrong?

3
  • 2
    Usually, one would rotate the labels, not the features. Else, one would rotate the entire map (that is, north is not straight up but at an angle). It sound very wrong to rotate each features, as it would change their coordinates (making the data close to useless)
    – JGH
    Commented Mar 13, 2018 at 15:47
  • can you join the point attribute to the road type and label via the linear/polygon direction?
    – Mapperz
    Commented Mar 13, 2018 at 17:12
  • Please, do not forget about "What should I do when someone answers my question?"
    – Taras
    Commented Aug 9 at 6:12

2 Answers 2

7

Yes, I think that is possible. Take a look in the properties of the Layer and go to Labels. Select the underpoint "Placement" form the list with Text, Formating, Buffer, ... there can you find under "Data defined" the Rotation. Define a field in the attribute table for the roation.

Now you can use the Label Toolbar for rotating the text.

Add a field to store the angle for the rotation.

1
  • 2
    and there is a "Layer to labeled layer " (plugins.qgis.org/plugins/toLabeledLayer) Plugin which does the things described by Cartographer for you (making fields vor offsetx, offsety and rotation) and setting the datadefined overriding...
    – eurojam
    Commented Mar 13, 2018 at 17:05
0

To label a line, you can use Placemenet Mode Curved. If you have (as I understood the question) a point layer containing the names for nearby roads etc., use overlay_nearest() to adjust the point's label placement to the nearest line feature: In label placement, activate Geometry Generator -> LineString and paste the following expression:

overlay_nearest ('streetlayer_name', @geometry)[0]

Here, the point-layer is labeled, placement is from the line-layer: enter image description here

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.