Within QGIS, you can obviously categorise by a field. This gives you the ability to select individual categories visibility (e.g. a name or similar.) Is there a way that I can cascade this selection to another layer, with an identical set of categories?

I've tried joining and using 'is_layer_visible' and 'is_selected' but this is not working (as presumably that is giving you layer level, not item level filtering.)

I have come up with a temporary solution currently, which is to filter the SQL query for each layer, split the shape files and layers, and put into groups. But this is slow and a big buggy.

  • 1
    Are you trying to toggle the visibility on a category in one layer, and have a category in another layer automatically toggle? – csk Mar 1 '19 at 17:46
  • 1
    is_selected refers to the selection state of each feature, not style category. – csk Mar 1 '19 at 17:50
  • I think you've answered my question csk.. you've essentially highlighted the two things im trying to do, but it can't. Only way I suspect is what I've done, or using python – Trum Mar 2 '19 at 22:34

Why not using the Virtual layer? As you already have some sql with filtering, make from it virtual layer. You can connect many layers in one and besides that, it will update automatically when you make some changes to base layers.

| improve this answer | |
  • At the moment I've used a filter for each layer, which works, but is fiddly. I've not used virtual layers a lot. Do you think they would be faster? – Trum Mar 2 '19 at 22:40

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.