I have a table with pairs of points. Out of that I want to create a line layer (that keeps all attributes of the table). One line for each raw from point to point. I want to calculate the length of these lines later.

A simplified example table would look like that: table

Can I make this in QGIS?

I am using QGIS 1.8.0 on a Mac 10.6.8


I just did something similar. I ended up stringing the from/to columns together in WKT format, and saving the file as a .txt which I then imported with the delimited text tool in QGIS. Select the WKT field, and it will create the lines for you.

  • Wow!! Thats awesome. I had to learn a few things about WKT but know it works perfectly fine. Thanks heaps! – stefan Mar 5 '13 at 17:50

I don't know exactly if this is possible with QGis 1.8 and with a MAC, but here is how i would approach this problem.

  • Create two point layers (origin and destination). Pay attention that both layers have the same attribute (line). So in your case one point-layer with the first coordinate set (From_Lat and From_Long) and the other set.
  • Merge them. Now you should have one big point layer with your source and destination points.
  • Use QGis Points-To-Path plugin or the Sextante SAGA module "Convert Points to lines" to create lines out of your points. Seperate the lines with the attribute you specified in your "line" column.

Thats it. Its probably even easier to create the lines with a R script or with other tools.

  • Hey, thanks for your answer, but I tried the other approach first. Thanks anyway. – stefan Mar 5 '13 at 17:51

There is an updated tool / plugin now in QGIS called Points 2 Paths

enter image description here


can someone just explain the first solution with WKT, how do you string up the cooridate pairs?

Thanks for your help!


  • If you have another question, please ask it. – John Powell Sep 19 '16 at 16:10

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.