How to set a dashed stroke style when layers have features with sharing borders?












5














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
    2 hours ago
















5














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
    2 hours ago














5












5








5


3





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 cartography qgis-3






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 hours ago









Koen Ver

514




514












  • Possible answers can be found at gis.stackexchange.com/questions/171182/…
    – Vadym
    2 hours ago


















  • Possible answers can be found at gis.stackexchange.com/questions/171182/…
    – Vadym
    2 hours ago
















Possible answers can be found at gis.stackexchange.com/questions/171182/…
– Vadym
2 hours ago




Possible answers can be found at gis.stackexchange.com/questions/171182/…
– Vadym
2 hours ago










2 Answers
2






active

oldest

votes


















2














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





























    0














    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%2fhow-to-set-a-dashed-stroke-style-when-layers-have-features-with-sharing-borders%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 "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


























        2














        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
























          2












          2








          2






          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 2 hours ago









          csk

          6,850733




          6,850733

























              0














              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


























                0














                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
























                  0












                  0








                  0






                  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 2 hours ago









                  TeddyTedTed

                  47819




                  47819






























                      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.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • 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%2fhow-to-set-a-dashed-stroke-style-when-layers-have-features-with-sharing-borders%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

                      Understanding the information contained in the Deep Space Network XML data?

                      Ross-on-Wye

                      Eastern Orthodox Church