5

Let's assume that I have selected some features in QGIS. Now all the features in that vector layer already has some style applied to it.

Now, I want to apply some new style to the selected features. Is this possible in QGIS?

2 Answers 2

9

If you selected your features by some attribute, then simply set that as a rule for the style (under Layer Properties), or use the attribute to adjust the global style by using the data-driven capabilities of the style manager.

If you selection was just a bunch of features you selected by hand that have no common, defining attribute, then I suggest, since you have a need to style them differently, you create a new attribute and give it a value for your selected features and then do as above.

4

There's an is_selected() function in the QGIS expression builder. This function returns true if the current feature is selected but false if it isn't. While this function can take zero, one or two arguments, you won't need any arguments for this solution.

Go to the field calculator. Create a new field. Choose text as the new field type. Enter is_selected() in the expression box. and click okay.

You will now have a new column in your attribute table. Features that you selected will be true while those which are not selected will be false.

You can now use the categorised symbology to style your layer based on the new column.

Since you said you already have an existing symbology, the rule based styling will be the better symbology option for you.enter image description here

1
  • This is more practical answer...
    – panoet
    Jan 19, 2022 at 3:19

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.