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.
I want to attain the green line
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityThere are several options to do this:
Create a new line-layer, toggle editing, activate snapping and draw a line by snapping to start- and endpoint.
Use this expression with Geometry generator or Geometry by expression (see here how):
make_line (start_point ($geometry),end_point ($geometry))
Create a virtual layer with this query:
select make_line (end_point (l.geometry), start_point (l.geometry))
from line as l