3

I am trying to find a way to display relevant information for a given zone based on all the layers that it intersects. For example, I'm studying five zones and I'd like to know for each of them which type of soil can be found within their boundaries.

I have tried to "join features by location" but I end up with multiple features when different type of soils are present in the area. This is not ideal because I'll have to repeat the process for many other layers (soil, geology, hydrography, ...)

In the image below for example, I would need to know which colors can be found within the red dotted area (yellow, blue, dark green and light green). It doesn't necessarily need to be stored as attributes, if I can have a .txt file with the info that's also fine.

enter image description here

1
  • Here is a solution using virtual layers
    – JGH
    Commented Apr 1, 2021 at 13:10

1 Answer 1

6

you can use the field calculator with the aggregate function for that task. The expression to collect information on your soil layer (where type is the fieldname in soil which will be aggregated) into a new column in the zones layer would be like the following:

aggregate(layer:='soil',
aggregate:='concatenate',
expression:="type",
filter:=intersects($geometry, geometry(@parent)),
concatenator:=',')

enter image description here

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.