How to automaticaly create a buffer for a line in QGIS












2















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?










share|improve this question























  • 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
    1 hour ago
















2















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?










share|improve this question























  • 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
    1 hour ago














2












2








2








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?










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 1 hour ago









ArthurArthur

17211




17211













  • 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
    1 hour 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
    1 hour 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
1 hour 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
1 hour ago










2 Answers
2






active

oldest

votes


















3














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.



enter image description here






share|improve this answer

































    1














    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.






    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%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









      3














      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.



      enter image description here






      share|improve this answer






























        3














        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.



        enter image description here






        share|improve this answer




























          3












          3








          3







          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.



          enter image description here






          share|improve this answer















          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.



          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 29 mins ago









          lambertj

          1,8631623




          1,8631623










          answered 1 hour ago









          J.RJ.R

          3,063221




          3,063221

























              1














              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.






              share|improve this answer




























                1














                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.






                share|improve this answer


























                  1












                  1








                  1







                  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.






                  share|improve this answer













                  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.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 25 mins ago









                  JGHJGH

                  11.8k21134




                  11.8k21134






























                      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%2f309150%2fhow-to-automaticaly-create-a-buffer-for-a-line-in-qgis%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

                      Knooppunt Holsloot

                      Altaar (religie)

                      Gregoriusmis