0

Following this query:

QGIS 3x conditional rotation of the label

I would like to rotate one label, which already has been assigned to one expression.

The previous expression looks like this:

 CASE
 WHEN "fid" = 18 then '5,-5'
 End

and applies to the offset for a whole rule-based label.

I tried to make something like this:

  CASE
  WHEN "fid" = 18 then '5,-5'
  End

  CASE WHEN "fid" = 17 then 60
  end

but the expression isn't valid.

I modified it a bit:

  CASE
  WHEN "fid" = 18 then '5,-5'
  WHEN "fid" = 17 then 60
  End

but it returns no reaction at all.

How can I change the rotation for this one label particularly?

I tried also via geometry generator:

enter image description here

but all my labels belonging to the rule disappeared.

The last way was here:

enter image description here

but it looks like I need some auxiliary columns in my data attribute table.

Can anyone help me to solve it?

2

If you want to apply an offset to a specific attribute value in the attribute table, you need to use the Data defined override of the offset only, and assign an offset value like this:

case
When "Id" = 10 then '-5,5'
else '0,0'
end

If you want to apply a rotation to the same specific value in the attribute table, you need to use the Data defined override of the Rotation only, and assign an rotation value like this:

case
When "Id" = 10 then 45.0
else 0.0
end

Adding offset and rotation expressions in either offset or rotation fields together is not possible. Each assignment should be written in its respective location.

The image below show where to enter the value for offset and same thing should be applied to rotation.

enter image description here

Here is the output:

enter image description here

Notice that the value 10 is the only label that is rotated and offsetted.

| improve this answer | |

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.