1

How can I combine these 2 features in the expression box?

   "auxiliary_storage_labeling_labeldistance"

and

 CASE 
 WHEN "fid" = 31 Then 34.0
 WHEN "fid" = 54 Then -62.0
 WHEN "fid" = 35 Then -55.0
 WHEN "fid" = 36 Then -55.0
 WHEN "fid" = 29 Then 28.0
 WHEN "fid" = 27 Then -62.0
 WHEN "fid" = 33 Then 26.0
 WHEN "fid" = 16 Then -67.0
 WHEN "fid" = 6 Then 25.0
 WHEN "fid" = 93 Then 40.0
 end

When I merge them 2, the console says, that expression is invalid.

The basic problem is, that if I start to use the auxiliary rotation, I am losing all the expressions at the same time.

1
  • I have already updated the question. The problem is, that if I set the expressions for i.e. 4 labels, and I want to rotate another 5 labels using the auxiliary rotation, I am losing all expressions.
    – Geographos
    Oct 7, 2020 at 15:16

1 Answer 1

2

Try re-arranging your case statement slightly and adding an 'else'. This will also allow you to manually move and rotate labels while maintaining your custom list of rotations.

This goes into the data-defined override for the Rotation, while the X and Y are already set to 'store data in project' aka using auxillary storage:

 CASE 
 WHEN "fid" = 31 Then 34.0
 WHEN "fid" = 54 Then -62.0
 WHEN "fid" = 35 Then -55.0
 WHEN "fid" = 36 Then -55.0
 WHEN "fid" = 29 Then 28.0
 WHEN "fid" = 27 Then -62.0
 WHEN "fid" = 33 Then 26.0
 WHEN "fid" = 16 Then -67.0
 WHEN "fid" = 6 Then 25.0
 WHEN "fid" = 93 Then 40.0
else   "auxiliary_storage_labeling_labeldistance"
 end

enter image description here

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.