New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expressions for label rotation does no longer work #44475
Comments
This is by design. Qgis 2.x used the opposite direction for label rotation vs symbol rotation, which lead to much confusion. It was fixed in 3.0, but in order to maintain project appearance the label rotation will be updated to the "360-angle" expression you're seeing whenever you open a project saved in 2.x. |
Thanks for your reply. But why is it impossible to set an expression for label rotation? screncast_qgis_3_16_9_label_rotation_expressions.mp4 |
That's a bug |
Perhaps this is a good moment to simplify some of our legacy QGIS 2 layer styles. |
QgsAuxiliaryLayer::createProperty(*) Instead, if a property already exists it will be upgraded to an expression based property of the form: coalesce("new aux field", 'existing' || 'property' || 'expression') (i.e. allow per-feature value overrides from the auxiliary field, but by default fallback to the existing property definition) Refs qgis#44475
properties of the form coalesce("new aux field", 'some' || 'expression') Refs qgis#44475
an interactive map tool is used to move/rotate/edit labels But instead automatically upgrade this property to use a coalesce("aux field", 'existing' || 'property' || 'expression') type expression, so that the tool will place the interactively edited position/rotation/etc in the auxiliary field but default to using the expression for all other features Fixes qgis#44475
QgsAuxiliaryLayer::createProperty(*) Instead, if a property already exists it will be upgraded to an expression based property of the form: coalesce("new aux field", 'existing' || 'property' || 'expression') (i.e. allow per-feature value overrides from the auxiliary field, but by default fallback to the existing property definition) Refs #44475
properties of the form coalesce("new aux field", 'some' || 'expression') Refs #44475
an interactive map tool is used to move/rotate/edit labels But instead automatically upgrade this property to use a coalesce("aux field", 'existing' || 'property' || 'expression') type expression, so that the tool will place the interactively edited position/rotation/etc in the auxiliary field but default to using the expression for all other features Fixes #44475
QgsAuxiliaryLayer::createProperty(*) Instead, if a property already exists it will be upgraded to an expression based property of the form: coalesce("new aux field", 'existing' || 'property' || 'expression') (i.e. allow per-feature value overrides from the auxiliary field, but by default fallback to the existing property definition) Refs qgis#44475
properties of the form coalesce("new aux field", 'some' || 'expression') Refs qgis#44475
an interactive map tool is used to move/rotate/edit labels But instead automatically upgrade this property to use a coalesce("aux field", 'existing' || 'property' || 'expression') type expression, so that the tool will place the interactively edited position/rotation/etc in the auxiliary field but default to using the expression for all other features Fixes qgis#44475
What is the bug or the crash?
When using the 'Rotate label' tool, expressions for rotation are always replaced by auxiliary storage in QGIS 3.x. It seems there is no way to deactivate auxiliary storage for label rotation. Please see the attached screencasts for more information.
screencast_qgis_2_18_28.mp4
screencast_qgis_3_16_9.mp4
QGIS file:
label_rotation_expression.zip
Steps to reproduce the issue
Please open the attached .qgs file in QGIS 2.x and 3.x and follow the steps seen in the screencast.
Versions
3.16.9
Additional context
When opening the .qgis file in QGIS 3.16.9 'Label rotation' does automatically change from field
rotation
to expression360-("rotation")
for"type"=1
and from expression180-"rotation"
to expression360-(180-"rotation")
for"type"=2
. This is quite strange. Is this a bug?The text was updated successfully, but these errors were encountered: