1

I want to create a straight line from two vertices of a line which are not straight, but I should be getting a straight line joining the start and end vertices of this curve line.

enter image description here

I want to attain the green line

1 Answer 1

7

There are several options to do this:

  1. Create a new line-layer, toggle editing, activate snapping and draw a line by snapping to start- and endpoint.

  2. Use this expression with Geometry generator or Geometry by expression (see here how): make_line (start_point ($geometry),end_point ($geometry))

  3. Create a virtual layer with this query:

    select make_line (end_point (l.geometry), start_point (l.geometry))
    from line as l
    
5
  • 1
    please ... don't answer so quick ... ;-p
    – Snaileater
    May 17, 2021 at 14:35
  • Sorry - you were to post the same answer...?
    – Babel
    May 17, 2021 at 14:36
  • Thanks for the competition! was really helpful May 17, 2021 at 14:56
  • You're welcome. From the three options, I prefer the 2nd one, using expressions. It seems to be the most straightforward as you don't have to create a new layer manually.
    – Babel
    May 17, 2021 at 14:58
  • Yeah, took the one with the expression only, so quick and effective results are coming. May 17, 2021 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.