I am trying to apply a rule to rotate symbols based on the value of an attribute.
I tried to copy Automatically changing the angle of a symbol in QGIS?, which is essentially my question, however it does not work for me.
I have a layer with two attributes, the slope and aspect. I want to colour the symbols by the slope (this part works) and rotate by the aspect.
The steps I take are:
Layer Properties -> Style -> Graduated -> Symbol -> Change
Select Simple Marker (arrow) and press the button to the right of angle -> field type (double) -> Aspect-sel
Applying these commands changes the symbol to an arrow, and I can easily apply the colour gradient, but the symbols do not rotate. The attribute Aspect-sel varies from 2.87 to 334.23.
ETA: I was using Version 2.8.3 - on suggestion I updated to 2.14.10, which solved the problem.
Answer
If you want to use a field in attribute table, you should select the field directly in the Data defined override
which has the angle value. The field should be of double/integer type not string field type. In the following figure I used at first Single Symbol
and select Data defined override
beside the rotation field, as you can see below:
Then, I changed the style from Single Symbol
to Graduated
and select another field (in your case slope field), as you can see below.
No comments:
Post a Comment