3

I have two layers:
Layer 1 - containing municipalities of country X in the year 2014 (around 600)
Layer 2 - containing municipalities of country X in the year 2018 (around 500)

Between 2014-2018 several municipalities have merged. E.g. municipality A, B and C in the 2014 layer no longer exist in 2018 but are now part of municipality D.

I want to know for each 2014 municipality what its corresponding 2018 municipality is. So for municipality A, B and C the outcome should be D.

enter image description here

enter image description here

I tried to achieve this by performing Join by Location (using intersect). I would expect the joined layer to have 600 features (i.e. the number of 2014 municipalities) with a new attribute containing the corresponding 2018 municipality. However, the joined layer I get has over 2400 features. Municipality A is present 4 times, one entry has municipality D as new attribute (as expected) but the other 3 entries have the neighbouring municipalities of A as new attribute (E, F and I). I.e. QGIS seems to think that municipality A does not only intersect with D but also with all neighbouring municipalities of A.

Am I doing something wrong here?

Both layers have the same CRS.

Edit: Found out that if I zoom in a lot (ratio 85:1) there's a small difference between the two layers. I guess this causes the issue.

enter image description here

4

The solution is to do the following:

  • Generate the centroids of the polygons of 2014
  • Spatially join the centroids with the polygons of 2018
  • Join by attribute the polygons of 2014 with their centroids

I hope this would help.

  • 3
    To add to this Intersection includes where the boundaries of a pair of polygons overlap (what you think of as touching). – Ian Turton Jan 11 at 14:25
2

Set it up the following:

  • As input layer choose your old municipalities (2014).
  • As join layer choose your new municiplaities (2018).
  • As geometric predicate choose overlaps, within and equals.

enter image description here

The result:

enter image description here

Of course this will only work if the actual boundaries did not move.

  • Thanks! I tried this but unfortunately still get 2500+ features. When I zoom in a ridiculous amount (85:1!) I can see that there's a small difference between the borders of the two layers. I guess that's the cause of this issue.. – tilkas Jan 11 at 16:55
  • 1
    yes, this only works when the border lines stay the same and just the area allocation changed. In your case you will then probably get a better result with centroids (or pointonsurface) as @MohannadAdham suggested. – MrXsquared Jan 11 at 17:07

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.