4

I'm using QGIS 3.18. For my thesis I use coordinates of starting points and destination points. So far I uploaded these coordinates into my project which worked without any problems. The CSV-file contains 4 columns: lat & long for both.

I have two layers - one for the starting points and the other one for the destination points. Now, I want to connect those points using lines but unfortunately I cannot find any plugin with suits those needs.

4

You could use the "Geometry by Expression" tool from the processing toolbox.

As input layer use your original CSV with all coordinate column, choose line as Output geometry type and use an expression like :

make_line( make_point( X_start , Y_start) , make_point( X_dest , Y_dest))

(replace the X_start , Y_start, X_dest and Y_dest by the actual field name of the respective coordinate)

This will create a new line layer with line joining your points.

If you just want to symbolize the line you could use the same expression in the geometry generator (in this case the line will only be displayed if the point is displayed, so if you set the geometry generator on starting point and zoom to the destination point enough to get the stating point out of frame the line will disappear)

4

If the start and end points have a common attribute like a name, or a code, you could merge all the points into one layer and use Points to Path to create the lines. The common attribute would be the Path group expression option in the tool.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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