[GIS] Make lines from points in Geometry Generator

qgis

I have a data set with a large number of start and end positions. I am trying to generate lines between start and end positions using the Geometry Generator but it does not work. I get no errors when running it, but the lines do not appear. I have found several answers to a similar qestion, e.g. this one, : Creating a line from two points in QGIS I select geometry Type as "LineString. Here is the code I have been trying to use. make_line(make_point("shootlon" ,"shootlat"), make_point("haullon", "haullat"))

enter image description here

Small screenshot of the data, which is a text ("txt") file.
What could be the problem? Some of the older plugins e.g. "Points2one", do not work in QGIS 3.4.4.

Best Answer

This is how my attribute table looks like

enter image description here

This is the expression to use :

make_line(make_point( "Xstart" , "Ystart" ),make_point( "Xend" , "Yend" ))

enter image description here

Then press Ok

Related Question