How to set a dashed stroke style when layers have features with sharing borders?
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)
How can I display all borders with a dashed stroke style? Now it seems to overlap.
qgis cartography qgis-3
add a comment |
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)
How can I display all borders with a dashed stroke style? Now it seems to overlap.
qgis cartography qgis-3
Possible answers can be found at gis.stackexchange.com/questions/171182/…
– Vadym
Jan 3 at 16:43
I guess you're right
– Koen Ver
2 days ago
add a comment |
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)
How can I display all borders with a dashed stroke style? Now it seems to overlap.
qgis cartography qgis-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)
How can I display all borders with a dashed stroke style? Now it seems to overlap.
qgis cartography qgis-3
qgis cartography qgis-3
asked Jan 3 at 16:06
Koen Ver
614
614
Possible answers can be found at gis.stackexchange.com/questions/171182/…
– Vadym
Jan 3 at 16:43
I guess you're right
– Koen Ver
2 days ago
add a comment |
Possible answers can be found at gis.stackexchange.com/questions/171182/…
– Vadym
Jan 3 at 16:43
I guess you're right
– Koen Ver
2 days ago
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
2 days ago
I guess you're right
– Koen Ver
2 days ago
add a comment |
2 Answers
2
active
oldest
votes
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.
You can prevent the two borders from overlapping by choosing the option "Draw line only inside polygon."
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.
- Run
Polygons to lines
algorithm to convert polygons to lines
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."
Apply the same style to the dissolved lines layer as you used for the polygon borders.
- (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.
add a comment |
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.
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
You can prevent the two borders from overlapping by choosing the option "Draw line only inside polygon."
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.
- Run
Polygons to lines
algorithm to convert polygons to lines
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."
Apply the same style to the dissolved lines layer as you used for the polygon borders.
- (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.
add a comment |
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.
You can prevent the two borders from overlapping by choosing the option "Draw line only inside polygon."
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.
- Run
Polygons to lines
algorithm to convert polygons to lines
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."
Apply the same style to the dissolved lines layer as you used for the polygon borders.
- (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.
add a comment |
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.
You can prevent the two borders from overlapping by choosing the option "Draw line only inside polygon."
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.
- Run
Polygons to lines
algorithm to convert polygons to lines
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."
Apply the same style to the dissolved lines layer as you used for the polygon borders.
- (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.
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.
You can prevent the two borders from overlapping by choosing the option "Draw line only inside polygon."
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.
- Run
Polygons to lines
algorithm to convert polygons to lines
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."
Apply the same style to the dissolved lines layer as you used for the polygon borders.
- (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.
answered Jan 3 at 16:39
csk
6,910733
6,910733
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Jan 3 at 16:47
TeddyTedTed
48819
48819
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Possible answers can be found at gis.stackexchange.com/questions/171182/…
– Vadym
Jan 3 at 16:43
I guess you're right
– Koen Ver
2 days ago