Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

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.

share|improve this answer
    
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
add comment

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.

share|improve this answer
    
Hey, thanks for your answer, but I tried the other approach first. Thanks anyway. –  stefan Mar 5 '13 at 17:51
add comment

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

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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