2

I'm trying to join the attributes from the polygon layers shown on the images.

The result I'm looking for is one layer that contains the square and the attributes of both triangles: the triangles are perfectly overlapped with the square.

example1

example2

I've tried to use "Join attributes by location" but the output layer is not what I'm looking for as it contains two overlapped squares one for each triangle.

Also, I've tried to intersect the layers but the result are two triangles and to join the vectorial layers but the result is again two triangles.

0

Your problem is that you want to join the attributes of two geometries in one. This will create a conflict with the fields name (they must be double to realise what you are looking for).

The best solution should be to run two times "Join attributes by location" using only one selected triangle for time.

Run a first time selection one triangle and using your triangle layer as Base layer. In the parameters be sure that you activate Selected features only for the Triangles layer and, in Joined field prefix use '1_'.

Run now a second time the algorithm selection the other triangle and using as Base layer the temporary layer created by the precedent operation, and in in Joined field prefix use '2_' to create different fields.enter image description here

| improve this answer | |
  • The issue is that the case shown is a simplification of a bigger one, it is not possible to do that. But still is a good idea. – Nacho del Saz Mar 1 at 19:32
  • 1
    How many Fields do you have in your attribute table? It could be solved by Field Calculator. – Val P Mar 1 at 19:34
  • 7, all of them are population data, but the problem is the number of polygons, i have more than 50 squares and more than 200 triangles,there are squares that constain up to 5 triangles. I am looking for a way to get all the atributtes from the triangles that are contained in a square to the square attribute table. – Nacho del Saz Mar 1 at 19:54

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.