How to automaticaly create a buffer for a line in QGIS
I am creating some lines, and I would like to add a 500m buffer around thoses lines. But i need this buffer to automaticaly change if i modify my line around.
Is there any solution to this?
qgis qgis-processing qgis-3.0
add a comment |
I am creating some lines, and I would like to add a 500m buffer around thoses lines. But i need this buffer to automaticaly change if i modify my line around.
Is there any solution to this?
qgis qgis-processing qgis-3.0
What do you mean by automatically change? Do you mean you are manually modifying the line your buffer is based off of?
– Trevor J. Smith
12 hours ago
add a comment |
I am creating some lines, and I would like to add a 500m buffer around thoses lines. But i need this buffer to automaticaly change if i modify my line around.
Is there any solution to this?
qgis qgis-processing qgis-3.0
I am creating some lines, and I would like to add a 500m buffer around thoses lines. But i need this buffer to automaticaly change if i modify my line around.
Is there any solution to this?
qgis qgis-processing qgis-3.0
qgis qgis-processing qgis-3.0
asked 13 hours ago
ArthurArthur
17711
17711
What do you mean by automatically change? Do you mean you are manually modifying the line your buffer is based off of?
– Trevor J. Smith
12 hours ago
add a comment |
What do you mean by automatically change? Do you mean you are manually modifying the line your buffer is based off of?
– Trevor J. Smith
12 hours ago
What do you mean by automatically change? Do you mean you are manually modifying the line your buffer is based off of?
– Trevor J. Smith
12 hours ago
What do you mean by automatically change? Do you mean you are manually modifying the line your buffer is based off of?
– Trevor J. Smith
12 hours ago
add a comment |
2 Answers
2
active
oldest
votes
You can create a virtual layer
that is linked to your source layer. It has the advantage of creating a new in-memory layer that can easily be turned on/off.
Go to menu layer / add layer / add - edit virtual layer
and use the formula
select st_buffer(geometry,500)
from myline;
The buffer distance is in the projection unit, so in meters or degrees.
I think it should beselect buffer(geometry,500) as geometry from myline
. And nice thing that virtual layers now get updated immediately.
– MrXsquared
7 hours ago
@MrXsquared Virtual Layers are truly awesome! Both buffer syntax are valid, and the alias is not needed (unless you want to run other queries on it). One may have to pan/refresh the map to see the new shape in the virtual layer.
– JGH
7 hours ago
add a comment |
One easy solution is to use the geometry generator, the drawback with this solution is that the buffer exists only on the display (not a layer you can reuse) and only in the document where it's configured. Also if you have many lines it may slow down rendering.
If you choose to go this way just go to the symbology tab of the line layer, click the plus to add a symbol layer and choose the Geometry generator type with Polygon/Multipolygon geometry then just type buffer( $geometry,500)
as function (this only work if you are working in a CRS in meter, if not you will need to add some reprojection to the function). You could then symbolize the buffer to your liking.
As the buffer is dynamically created on the line geometry it will reflect any change to the line.
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%2f309150%2fhow-to-automaticaly-create-a-buffer-for-a-line-in-qgis%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
You can create a virtual layer
that is linked to your source layer. It has the advantage of creating a new in-memory layer that can easily be turned on/off.
Go to menu layer / add layer / add - edit virtual layer
and use the formula
select st_buffer(geometry,500)
from myline;
The buffer distance is in the projection unit, so in meters or degrees.
I think it should beselect buffer(geometry,500) as geometry from myline
. And nice thing that virtual layers now get updated immediately.
– MrXsquared
7 hours ago
@MrXsquared Virtual Layers are truly awesome! Both buffer syntax are valid, and the alias is not needed (unless you want to run other queries on it). One may have to pan/refresh the map to see the new shape in the virtual layer.
– JGH
7 hours ago
add a comment |
You can create a virtual layer
that is linked to your source layer. It has the advantage of creating a new in-memory layer that can easily be turned on/off.
Go to menu layer / add layer / add - edit virtual layer
and use the formula
select st_buffer(geometry,500)
from myline;
The buffer distance is in the projection unit, so in meters or degrees.
I think it should beselect buffer(geometry,500) as geometry from myline
. And nice thing that virtual layers now get updated immediately.
– MrXsquared
7 hours ago
@MrXsquared Virtual Layers are truly awesome! Both buffer syntax are valid, and the alias is not needed (unless you want to run other queries on it). One may have to pan/refresh the map to see the new shape in the virtual layer.
– JGH
7 hours ago
add a comment |
You can create a virtual layer
that is linked to your source layer. It has the advantage of creating a new in-memory layer that can easily be turned on/off.
Go to menu layer / add layer / add - edit virtual layer
and use the formula
select st_buffer(geometry,500)
from myline;
The buffer distance is in the projection unit, so in meters or degrees.
You can create a virtual layer
that is linked to your source layer. It has the advantage of creating a new in-memory layer that can easily be turned on/off.
Go to menu layer / add layer / add - edit virtual layer
and use the formula
select st_buffer(geometry,500)
from myline;
The buffer distance is in the projection unit, so in meters or degrees.
answered 12 hours ago
JGHJGH
11.9k21134
11.9k21134
I think it should beselect buffer(geometry,500) as geometry from myline
. And nice thing that virtual layers now get updated immediately.
– MrXsquared
7 hours ago
@MrXsquared Virtual Layers are truly awesome! Both buffer syntax are valid, and the alias is not needed (unless you want to run other queries on it). One may have to pan/refresh the map to see the new shape in the virtual layer.
– JGH
7 hours ago
add a comment |
I think it should beselect buffer(geometry,500) as geometry from myline
. And nice thing that virtual layers now get updated immediately.
– MrXsquared
7 hours ago
@MrXsquared Virtual Layers are truly awesome! Both buffer syntax are valid, and the alias is not needed (unless you want to run other queries on it). One may have to pan/refresh the map to see the new shape in the virtual layer.
– JGH
7 hours ago
I think it should be
select buffer(geometry,500) as geometry from myline
. And nice thing that virtual layers now get updated immediately.– MrXsquared
7 hours ago
I think it should be
select buffer(geometry,500) as geometry from myline
. And nice thing that virtual layers now get updated immediately.– MrXsquared
7 hours ago
@MrXsquared Virtual Layers are truly awesome! Both buffer syntax are valid, and the alias is not needed (unless you want to run other queries on it). One may have to pan/refresh the map to see the new shape in the virtual layer.
– JGH
7 hours ago
@MrXsquared Virtual Layers are truly awesome! Both buffer syntax are valid, and the alias is not needed (unless you want to run other queries on it). One may have to pan/refresh the map to see the new shape in the virtual layer.
– JGH
7 hours ago
add a comment |
One easy solution is to use the geometry generator, the drawback with this solution is that the buffer exists only on the display (not a layer you can reuse) and only in the document where it's configured. Also if you have many lines it may slow down rendering.
If you choose to go this way just go to the symbology tab of the line layer, click the plus to add a symbol layer and choose the Geometry generator type with Polygon/Multipolygon geometry then just type buffer( $geometry,500)
as function (this only work if you are working in a CRS in meter, if not you will need to add some reprojection to the function). You could then symbolize the buffer to your liking.
As the buffer is dynamically created on the line geometry it will reflect any change to the line.
add a comment |
One easy solution is to use the geometry generator, the drawback with this solution is that the buffer exists only on the display (not a layer you can reuse) and only in the document where it's configured. Also if you have many lines it may slow down rendering.
If you choose to go this way just go to the symbology tab of the line layer, click the plus to add a symbol layer and choose the Geometry generator type with Polygon/Multipolygon geometry then just type buffer( $geometry,500)
as function (this only work if you are working in a CRS in meter, if not you will need to add some reprojection to the function). You could then symbolize the buffer to your liking.
As the buffer is dynamically created on the line geometry it will reflect any change to the line.
add a comment |
One easy solution is to use the geometry generator, the drawback with this solution is that the buffer exists only on the display (not a layer you can reuse) and only in the document where it's configured. Also if you have many lines it may slow down rendering.
If you choose to go this way just go to the symbology tab of the line layer, click the plus to add a symbol layer and choose the Geometry generator type with Polygon/Multipolygon geometry then just type buffer( $geometry,500)
as function (this only work if you are working in a CRS in meter, if not you will need to add some reprojection to the function). You could then symbolize the buffer to your liking.
As the buffer is dynamically created on the line geometry it will reflect any change to the line.
One easy solution is to use the geometry generator, the drawback with this solution is that the buffer exists only on the display (not a layer you can reuse) and only in the document where it's configured. Also if you have many lines it may slow down rendering.
If you choose to go this way just go to the symbology tab of the line layer, click the plus to add a symbol layer and choose the Geometry generator type with Polygon/Multipolygon geometry then just type buffer( $geometry,500)
as function (this only work if you are working in a CRS in meter, if not you will need to add some reprojection to the function). You could then symbolize the buffer to your liking.
As the buffer is dynamically created on the line geometry it will reflect any change to the line.
edited 12 hours ago
lambertj
1,8631623
1,8631623
answered 12 hours ago
J.RJ.R
3,083221
3,083221
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.
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%2f309150%2fhow-to-automaticaly-create-a-buffer-for-a-line-in-qgis%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
What do you mean by automatically change? Do you mean you are manually modifying the line your buffer is based off of?
– Trevor J. Smith
12 hours ago