QGIS3 - Join by location (falsely) adds neighbouring polygons












2















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.










share|improve this question









New contributor




tilkas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    2















    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.










    share|improve this question









    New contributor




    tilkas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      2












      2








      2








      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.










      share|improve this question









      New contributor




      tilkas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      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.







      qgis






      share|improve this question









      New contributor




      tilkas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      tilkas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 1 hour ago







      tilkas













      New contributor




      tilkas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 hour ago









      tilkastilkas

      112




      112




      New contributor




      tilkas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      tilkas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      tilkas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          2 Answers
          2






          active

          oldest

          votes


















          2














          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.






          share|improve this answer



















          • 1





            To add to this Intersection includes where the boundaries of a pair of polygons overlap (what you think of as touching).

            – Ian Turton
            1 hour ago



















          1














          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.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "79"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });






            tilkas is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f308343%2fqgis3-join-by-location-falsely-adds-neighbouring-polygons%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            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.






            share|improve this answer



















            • 1





              To add to this Intersection includes where the boundaries of a pair of polygons overlap (what you think of as touching).

              – Ian Turton
              1 hour ago
















            2














            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.






            share|improve this answer



















            • 1





              To add to this Intersection includes where the boundaries of a pair of polygons overlap (what you think of as touching).

              – Ian Turton
              1 hour ago














            2












            2








            2







            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.






            share|improve this answer













            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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 1 hour ago









            Mohannad AdhamMohannad Adham

            31915




            31915








            • 1





              To add to this Intersection includes where the boundaries of a pair of polygons overlap (what you think of as touching).

              – Ian Turton
              1 hour ago














            • 1





              To add to this Intersection includes where the boundaries of a pair of polygons overlap (what you think of as touching).

              – Ian Turton
              1 hour ago








            1




            1





            To add to this Intersection includes where the boundaries of a pair of polygons overlap (what you think of as touching).

            – Ian Turton
            1 hour ago





            To add to this Intersection includes where the boundaries of a pair of polygons overlap (what you think of as touching).

            – Ian Turton
            1 hour ago













            1














            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.






            share|improve this answer




























              1














              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.






              share|improve this answer


























                1












                1








                1







                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.






                share|improve this answer













                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 45 mins ago









                MrXsquaredMrXsquared

                962216




                962216






















                    tilkas is a new contributor. Be nice, and check out our Code of Conduct.










                    draft saved

                    draft discarded


















                    tilkas is a new contributor. Be nice, and check out our Code of Conduct.













                    tilkas is a new contributor. Be nice, and check out our Code of Conduct.












                    tilkas is a new contributor. Be nice, and check out our Code of Conduct.
















                    Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f308343%2fqgis3-join-by-location-falsely-adds-neighbouring-polygons%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Ronny Ackermann

                    Köttigit

                    MySQL 8.0.15 starts normally but any connection hangs