2

I'm in the search of the right tool to accomplish the following tasks:

I have vector layer A,B,C and D.

I want to overlay vector layer A with B, C and D.

If, for example, vector layer B is overlapping vector layer A, I'd like to have this printed out in a new attribute field for example "A+B"='yes'. Same goes for C and D. So I expect to have three new fields in the attribute table of layer A which tell me if the layer B, C and D do overlap it with yes and no or 1 and 0. Is this possible?

2
  • Are you interested only if a layer overlaps another layer, or do you need to know per feature?
    – Matt
    Mar 16, 2023 at 14:58
  • hey matt, it's per feature. Mar 16, 2023 at 16:43

1 Answer 1

8

You can get pretty close with:

  1. Merge vector layers. It will merge the four layers into one with a column named layer with the name of the layer, for example A,B,C or D
  2. Union the merge with the merge as input layer, no overlay layer. It will create all existing overlapping geometries. For example where A and B overlap there will be one geometry with layer attribute A and another exactly the same with layer attribute B
  3. Aggregate the output with $geometry as group by expression and concatenate layer as aggregate: enter image description here

The output will have a field with all overlapping layers as an attribute: enter image description here

2
  • This looks like a similar approach to that following a merge and running the polygon self intersection tool from the SAGA tools in processing.
    – John
    Mar 17, 2023 at 1:08
  • 1
    Thanks a lot for the detailed solution! Mar 20, 2023 at 6:43

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.