3

So I've got these tornado .csv files that have two latitude & longitude entries with the left-most in the table being the beginning point and the right-most being the ending point of the tornado, as is described here. I'm wondering, how can I link these two points in QGIS, so I get a line?

2
  • How might you represent change in direction over time? There are multiple .csv files for quite a few years back. What technique might you suggest to capture this temporal change in tornado patterns?
    – Trancot
    Dec 10, 2013 at 23:09
  • 1
    Once you have figured out the answer to your first question, it is better to ask the 2nd & 3rd questions (in your comment) as separate questions. Dec 10, 2013 at 23:50

1 Answer 1

7

The simple way to do this, without writing any Python, would be to translate the start and end to a WKT version of the line:

  1. Open the csv in Excel or Open Office, or whatever you use
  2. Create a new column with the formula:

    ="LINESTRING(" & A1 & " " & B1 & "," & C1 & " " & D1 & ")"

    Replacing A1, etc, with your start and end points.

  3. That should give you something like this:

    enter image description here

  4. Save the file and open it in QGIS using the Add Delimited Text File

    enter image description here

    Note: If you tick Watch file any time the file changes the map will auto update.

  5. Magic!

    enter image description here

2
  • that's brilliant! The best part is that one can generalize this approach to create all sorts of interesting geometry from a csv file via WKT. Thanks.
    – Llaves
    Dec 11, 2013 at 3:33
  • Indeed one can. And in the next version of QGIS you will just be able to copy and paste WKT into QGIS (no attributes yet)
    – Nathan W
    Dec 11, 2013 at 3:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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