3

How can I manually position these numbers for a better position in a polygon layer?

enter image description here

Carlos Pires
  • 1,135
  • 10
  • 24

4 Answers4

3

You could use the easy custom label plugin to move them where you want. See my blog post for a longer example of how this works.

Spacedman
  • 63,755
  • 5
  • 81
  • 115
Ian Turton
  • 81,417
  • 6
  • 84
  • 185
3

Following the suggestion of @Joseph, I solved the question by this way:

Assuming that there are already defined labels.

Step 1: created two fields; xLabel and YLabel, decimal type, length 20, precision 4.

Step 2: Layer Properties > Labels > Placement > Data defined, maped the X and Y fields in 'Attribute field' to match with the fields previously created xLabel and YLabel.

Step 3: (the only action to repeat for each problematic label - activate Edit): With the Move label tool dragged the label to the desired position. The new position is automatically recorded in the xLabel and YLabel fields.

Carlos Pires
  • 1,135
  • 10
  • 24
2

I suggest that you use a custom rule-based placement for each feature label. You do this by creating a label-placement rule associated a unique value that the feature contains (e.g a id, gid or any other field which is unique).

  1. Go to properties for the layer (right click layer and choose properties) and pick the 'Labels' tab.
  2. Choose rule-based labelling in the dropdown, and press the '+' icon. enter image description here
  3. Filter on the unique value (in the example it is the field "id" and the integer 1). Choose offset from centroid and play around with the x,y values and quadrant placement until it looks good. enter image description here

Repeat this for each point for which you want to manually place. With enough fiddling it should work.

JonasPedersen
  • 880
  • 1
  • 8
  • 19
  • 1
    the problem with this approach is that there needs to be one rule per feature. You could use 'single symbol' and add two fields (one for offset, e.g. "10,0" and one for quadrant), then use these as expressions. But both these approaches are more effort than using the built-in Move Label tool. (I've tried this approach, and it does work in some very specific situations, but those could use the new Cartographic Placement option in 2.14 instead) – Steven Kay May 24 '16 at 20:28
  • Thanks for the clarification. Was not aware of the 'Move Label' tool until today. – JonasPedersen May 25 '16 at 07:52
1

Create a polygon centroid, and then move the centroids where you want.

Frodo
  • 2,407
  • 1
  • 18
  • 36