Setting dashed stroke style when layers have features with sharing borders in QGIS?












8















Layers like municipalities, countries, ... have features sharing the border of their neighbours: they share the same vertices (except for the features at the edges off course).



I have a municipality layer, which I set with a dashed stroke style.
However, for adjacent features, the borders are displayed as a solid line (see picture)
enter image description here



How can I display all borders with a dashed stroke style?



Now it seems to overlap.










share|improve this question

























  • Possible answers can be found at gis.stackexchange.com/questions/171182/…

    – Vadym
    Jan 3 at 16:43











  • I guess you're right

    – Koen Ver
    Jan 4 at 10:20
















8















Layers like municipalities, countries, ... have features sharing the border of their neighbours: they share the same vertices (except for the features at the edges off course).



I have a municipality layer, which I set with a dashed stroke style.
However, for adjacent features, the borders are displayed as a solid line (see picture)
enter image description here



How can I display all borders with a dashed stroke style?



Now it seems to overlap.










share|improve this question

























  • Possible answers can be found at gis.stackexchange.com/questions/171182/…

    – Vadym
    Jan 3 at 16:43











  • I guess you're right

    – Koen Ver
    Jan 4 at 10:20














8












8








8


4






Layers like municipalities, countries, ... have features sharing the border of their neighbours: they share the same vertices (except for the features at the edges off course).



I have a municipality layer, which I set with a dashed stroke style.
However, for adjacent features, the borders are displayed as a solid line (see picture)
enter image description here



How can I display all borders with a dashed stroke style?



Now it seems to overlap.










share|improve this question
















Layers like municipalities, countries, ... have features sharing the border of their neighbours: they share the same vertices (except for the features at the edges off course).



I have a municipality layer, which I set with a dashed stroke style.
However, for adjacent features, the borders are displayed as a solid line (see picture)
enter image description here



How can I display all borders with a dashed stroke style?



Now it seems to overlap.







qgis symbology qgis-3






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 8 at 23:37









PolyGeo

53.3k1779238




53.3k1779238










asked Jan 3 at 16:06









Koen VerKoen Ver

664




664













  • Possible answers can be found at gis.stackexchange.com/questions/171182/…

    – Vadym
    Jan 3 at 16:43











  • I guess you're right

    – Koen Ver
    Jan 4 at 10:20



















  • Possible answers can be found at gis.stackexchange.com/questions/171182/…

    – Vadym
    Jan 3 at 16:43











  • I guess you're right

    – Koen Ver
    Jan 4 at 10:20

















Possible answers can be found at gis.stackexchange.com/questions/171182/…

– Vadym
Jan 3 at 16:43





Possible answers can be found at gis.stackexchange.com/questions/171182/…

– Vadym
Jan 3 at 16:43













I guess you're right

– Koen Ver
Jan 4 at 10:20





I guess you're right

– Koen Ver
Jan 4 at 10:20










2 Answers
2






active

oldest

votes


















6














The "solid" border is actually two dashed lines. The dash patterns aren't aligned, so the dashes of each line cover the spaces of the other, creating the appearance of a solid line.



enter image description here



You can prevent the two borders from overlapping by choosing the option "Draw line only inside polygon."



enter image description here



This is the simplest method, but it has two downsides:




  • The dash patterns of shared borders are still mis-aligned.

  • The line width is cut in half around the outsides of the area, while the interior borders still appear full width.


To truly fix the issue, convert your polygons to lines.




  1. Run Polygons to lines algorithm to convert polygons to lines


  2. Run Dissolve algorithm to remove overlapping line segments.



    Note: this algorithm creates a temporary layer by default, which will be deleted when you close the project. Be sure to save the temporary layer by right clicking on the layer name and choosing the option "make permanent."



  3. Apply the same style to the dissolved lines layer as you used for the polygon borders.



enter image description here




  1. (Optional) If you want filled polygons, set the border stroke style to "No pen" for the polygon layer. Put the line layer above the polygon layer.






share|improve this answer































    1














    This is not an ideal solution (and I hope someone answers with a better one) but as an interim work-around you could try to following:




    • Convert the polygons to lines (Polygons to Lines)

    • Explode the lines features into segments (Explode Lines)

    • Delete duplicate lines (advice on that here), these are the ones where polygons share boundaries

    • Symbolise the resulting individual lines as dashed and use the original polygons as the fill


    Not great I know but hope it helps.






    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
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f307495%2fsetting-dashed-stroke-style-when-layers-have-features-with-sharing-borders-in-qg%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









      6














      The "solid" border is actually two dashed lines. The dash patterns aren't aligned, so the dashes of each line cover the spaces of the other, creating the appearance of a solid line.



      enter image description here



      You can prevent the two borders from overlapping by choosing the option "Draw line only inside polygon."



      enter image description here



      This is the simplest method, but it has two downsides:




      • The dash patterns of shared borders are still mis-aligned.

      • The line width is cut in half around the outsides of the area, while the interior borders still appear full width.


      To truly fix the issue, convert your polygons to lines.




      1. Run Polygons to lines algorithm to convert polygons to lines


      2. Run Dissolve algorithm to remove overlapping line segments.



        Note: this algorithm creates a temporary layer by default, which will be deleted when you close the project. Be sure to save the temporary layer by right clicking on the layer name and choosing the option "make permanent."



      3. Apply the same style to the dissolved lines layer as you used for the polygon borders.



      enter image description here




      1. (Optional) If you want filled polygons, set the border stroke style to "No pen" for the polygon layer. Put the line layer above the polygon layer.






      share|improve this answer




























        6














        The "solid" border is actually two dashed lines. The dash patterns aren't aligned, so the dashes of each line cover the spaces of the other, creating the appearance of a solid line.



        enter image description here



        You can prevent the two borders from overlapping by choosing the option "Draw line only inside polygon."



        enter image description here



        This is the simplest method, but it has two downsides:




        • The dash patterns of shared borders are still mis-aligned.

        • The line width is cut in half around the outsides of the area, while the interior borders still appear full width.


        To truly fix the issue, convert your polygons to lines.




        1. Run Polygons to lines algorithm to convert polygons to lines


        2. Run Dissolve algorithm to remove overlapping line segments.



          Note: this algorithm creates a temporary layer by default, which will be deleted when you close the project. Be sure to save the temporary layer by right clicking on the layer name and choosing the option "make permanent."



        3. Apply the same style to the dissolved lines layer as you used for the polygon borders.



        enter image description here




        1. (Optional) If you want filled polygons, set the border stroke style to "No pen" for the polygon layer. Put the line layer above the polygon layer.






        share|improve this answer


























          6












          6








          6







          The "solid" border is actually two dashed lines. The dash patterns aren't aligned, so the dashes of each line cover the spaces of the other, creating the appearance of a solid line.



          enter image description here



          You can prevent the two borders from overlapping by choosing the option "Draw line only inside polygon."



          enter image description here



          This is the simplest method, but it has two downsides:




          • The dash patterns of shared borders are still mis-aligned.

          • The line width is cut in half around the outsides of the area, while the interior borders still appear full width.


          To truly fix the issue, convert your polygons to lines.




          1. Run Polygons to lines algorithm to convert polygons to lines


          2. Run Dissolve algorithm to remove overlapping line segments.



            Note: this algorithm creates a temporary layer by default, which will be deleted when you close the project. Be sure to save the temporary layer by right clicking on the layer name and choosing the option "make permanent."



          3. Apply the same style to the dissolved lines layer as you used for the polygon borders.



          enter image description here




          1. (Optional) If you want filled polygons, set the border stroke style to "No pen" for the polygon layer. Put the line layer above the polygon layer.






          share|improve this answer













          The "solid" border is actually two dashed lines. The dash patterns aren't aligned, so the dashes of each line cover the spaces of the other, creating the appearance of a solid line.



          enter image description here



          You can prevent the two borders from overlapping by choosing the option "Draw line only inside polygon."



          enter image description here



          This is the simplest method, but it has two downsides:




          • The dash patterns of shared borders are still mis-aligned.

          • The line width is cut in half around the outsides of the area, while the interior borders still appear full width.


          To truly fix the issue, convert your polygons to lines.




          1. Run Polygons to lines algorithm to convert polygons to lines


          2. Run Dissolve algorithm to remove overlapping line segments.



            Note: this algorithm creates a temporary layer by default, which will be deleted when you close the project. Be sure to save the temporary layer by right clicking on the layer name and choosing the option "make permanent."



          3. Apply the same style to the dissolved lines layer as you used for the polygon borders.



          enter image description here




          1. (Optional) If you want filled polygons, set the border stroke style to "No pen" for the polygon layer. Put the line layer above the polygon layer.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 3 at 16:39









          cskcsk

          6,995733




          6,995733

























              1














              This is not an ideal solution (and I hope someone answers with a better one) but as an interim work-around you could try to following:




              • Convert the polygons to lines (Polygons to Lines)

              • Explode the lines features into segments (Explode Lines)

              • Delete duplicate lines (advice on that here), these are the ones where polygons share boundaries

              • Symbolise the resulting individual lines as dashed and use the original polygons as the fill


              Not great I know but hope it helps.






              share|improve this answer




























                1














                This is not an ideal solution (and I hope someone answers with a better one) but as an interim work-around you could try to following:




                • Convert the polygons to lines (Polygons to Lines)

                • Explode the lines features into segments (Explode Lines)

                • Delete duplicate lines (advice on that here), these are the ones where polygons share boundaries

                • Symbolise the resulting individual lines as dashed and use the original polygons as the fill


                Not great I know but hope it helps.






                share|improve this answer


























                  1












                  1








                  1







                  This is not an ideal solution (and I hope someone answers with a better one) but as an interim work-around you could try to following:




                  • Convert the polygons to lines (Polygons to Lines)

                  • Explode the lines features into segments (Explode Lines)

                  • Delete duplicate lines (advice on that here), these are the ones where polygons share boundaries

                  • Symbolise the resulting individual lines as dashed and use the original polygons as the fill


                  Not great I know but hope it helps.






                  share|improve this answer













                  This is not an ideal solution (and I hope someone answers with a better one) but as an interim work-around you could try to following:




                  • Convert the polygons to lines (Polygons to Lines)

                  • Explode the lines features into segments (Explode Lines)

                  • Delete duplicate lines (advice on that here), these are the ones where polygons share boundaries

                  • Symbolise the resulting individual lines as dashed and use the original polygons as the fill


                  Not great I know but hope it helps.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 3 at 16:47









                  TeddyTedTedTeddyTedTed

                  54919




                  54919






























                      draft saved

                      draft discarded




















































                      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%2f307495%2fsetting-dashed-stroke-style-when-layers-have-features-with-sharing-borders-in-qg%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

                      Human spaceflight

                      Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                      張江高科駅