3

I have two layers and I want to join the attribute of them together in QGIS. Unfortunately, the overlapping layer (The Blue one) ist not very precicse, so there are parts that overlap on small areas.

enter image description here

If I join the attributes together (-> join type: intersects/one to many), I get multiple overlapping attributes. But i only want the attributes with the biggest overlaping area, which would be those:

enter image description here

If join the attributes together with the one to one method, I often get the attribute of the small overlapping parts, which i dont need/are wrong. I know I can get the mean attributes of all overlapping areas with the Join Attributes by Location (summary) function, which is partly a solution to my problem.

But what I really want is to only join the attribute with the biggest overlapping area. Any idea how to do this?

1
  • You could run an intersect, calculate $area for this intersect, then join attributes by location the intersect to your original yellowish layer and finally select by attribute the geometry with the largest joined area for each geometry with an identical ID (provided, you have IDs on your yellowish layer in the first place).
    – Erik
    Jul 21 '20 at 10:20
3

In qgis there is a plugin called select by centroid. But building on that I developed my own model to join based on the layer centroids by converting the layer to centroids and then join that table... Works a treat

0
6

The "Join Attributes by Location" algorithm from the Processing Toolbox has a switch to do exactly this:

enter image description here

2
  • 1
    Is it new ? I had a similar problem and I'm pretty sure QGIS wasn't any help.. I wrote a python script with geopandas (so I can make use of multiprocessing)
    – vidlb
    Jul 22 '20 at 21:22
  • 2
    I think it was introduced in 3.12
    – ndawson
    Jul 22 '20 at 22:15

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.