3

I have two polygon layers: the first one contains small land lots (green in the image), the second one contains large zones (the purple line in the image attached separates 2 such zones).

I want to link (the id's of) the large zones in layer 2 to the small parcels in layer one, using the largest overlap as criteria or measure: the small parcel gets the id of the large zone with which it has the largest overlap.

How can this be done in QGIS?

enter image description here

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
  • 2
    Your problem is probably the same as here http://gis.stackexchange.com/questions/148526/how-to-map-a-building-to-only-one-grid-which-contain-more-than-half-of-its-area/148537#148537 – user30184 May 27 '15 at 08:35
  • Thanks but no: I don't need to aggregate attributes as this OpenJump tool suggests. Anyway, I found another post, similar and with a working solution, though not so straight forward. –  May 27 '15 at 09:35
  • @theej In light of the other solution that you have found, which you suggest may be sub-optimal, it may be worth you using the edit button to revise your question with more details of what you have tried to answer your own question. – PolyGeo May 27 '15 at 10:02
  • 2
    Sorry, I understood that the small parcel gets the id of the large zone with which it has the largest overlap meant that you wanted to add an attribute "large_zone_id" into the layer of "small_parcel" and populate that new attribute with a correct large zone id. That can be done by aggregate utility. Obviously you wanted to do something else and found a solution which is great. – user30184 May 27 '15 at 10:40
  • @PolyGeo Sure, tell me what to do. This was my first question here, still getting used to the procedures. The other question was suggested to me by the 'system' as being similar. It is indeed related, but not the same. Hence, this question remains on its own, and the solution to the other question turned out to be also a solution to mine. I've tested it. It is very cumbersome using pivot tables and all, but it does the trick. –  May 27 '15 at 11:10
  • It is your question and not one that I can offer any easy advice on beyond that linked from our [help/on-topic] as What makes a good question? – PolyGeo May 27 '15 at 11:43
  • 1
    Actually I think @user30184's solution is a perfect fit here since this question is open to any software (and I'd upvote that answer here). If you read through the solution and look at what it actually does, despite naming conventions, I think it would solve your problem better than my solution of having to cut up and compare and join back. Sometimes tools can be used to do things they either aren't or at least don't sound like they're meant to. I'm not aware of a similar tool in either QGIS or ArcGIS (at least not without using a split/merge policy on a feature layer). – Chris W May 27 '15 at 19:53
  • @Chris W Yes, you are absolutely right. user30184's answer was correct and also easier, although I am not really using OpenJump, but willing to install if need be. I also marked this question as duplicate of the other questions and its 2 answers (the complicated one, and the OpenJump one). On a side note: sometimes I am stunned how "basic functionality" like this (yes, for me, this is almost JTS basic) seems missing in even mature software like QGIS or GRASS. Luckily, in freeware and open source, we have choice! –  May 28 '15 at 11:43

2 Answers2

0

This question is not the same but very related and the solution could work for me too, although it is not as straight forward as I would like it to be:

How to map a building to only one grid which contain more than half of its area using qgis?

Other suggestions are still welcome.

-1

You could use the menu Vector->Data Management Tools->Join attributes by location.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
luca76
  • 241
  • 1
  • 7
  • 2
    Thanks but this tool does not allow me to "Take the attributes of the feature with the largest overlap", which is what I am looking for. –  May 27 '15 at 09:37