I have an Excel (Fig) which has both "X" & "Y" in projected coordinates (WGS84/UTM). Is it possible to draw lines between the "X" & "Y"in QGIS?

I've tried to create points based on X,From_y and X,To_y. I've created two points by just loading them using add delimiter layer (pasted To_Y below From_Y and loaded it). Then tried with Points 2 paths. But it didn't work out.

Anyone know how to fix this ?

All i need is traverse line between the points

enter image description here

This is what i am looking for. I've coordinates(X1, a1 and X1, a2) for n number of points which has to be connected by a vertical line

enter image description here

  • So where you've got x1 and a1 and a2 you've got actual numbers in your spreadsheet? And the X coordinate is the same for from and to? So the lines are vertical? Not clear.
    – Spacedman
    Commented Aug 23, 2014 at 13:48
  • @Spacedman yes. It has to be a vertical line. I've just edited the question & added an image with respect to this.
    – joseph_k
    Commented Aug 25, 2014 at 8:45
  • Please, do not forget about "What should I do when someone answers my question?"
    – Taras
    Commented Feb 22, 2022 at 8:06

1 Answer 1


The quickest way to do this with a single line would be using the QuickWKT plugin; you can then right-click and Save As to any format you need.

Let's say your two points are in UTM Zone 36S, and here are listed as x (easting), y (northing):

  1. 151930,9593414
  2. 184802,9587212

The WKT format for a line is:

SRID=SRID;LINESTRING (x1 y1, x2 y2, x3 y3, ...)

Thus, for the example above:

SRID=32736;LINESTRING (151930 9593414, 184802 9587212)

Pasted into the QuickWKT plugin text box:

enter image description here

For larger sets of data, you can make an Excel table into a geographic data type by building that WKT string into a column, i.e. (where A2-D2 contain two sets of XY coords):

=CONCATENATE("SRID=32736;LINESTRING (",A2, " ", B2, ",", C2, " ", D2, ")")

You can save from Excel as a CSV and then use the add delimited text in QGIS (with "watch file" selected to keep it updated).

  • It works great for an area. But my requirement is a bit different. I've edited the question & added an image. Pls have a look.
    – joseph_k
    Commented Aug 25, 2014 at 8:41
  • The formula for the Excel table is nearly the same, just replace C2 by A2 to get a vertical line.
    – AndreJ
    Commented Aug 25, 2014 at 8:57
  • @AndreJoost Yep. It has successfully drawn the lines. But there has been an issue with the coordinate system. This is the formula which i've used SRID=32643;LINESTRING (332950 2293660,332950 2296680) The coordinate system is 32643: WGS84/UTM 43N. But the loaded wkt file (even though it has lines) is out of range. I've checked "Enable on the fly CRS...". But still it's the same.
    – joseph_k
    Commented Aug 25, 2014 at 10:11
  • 1
    Under Settings-> Options, CRS tab, CRS for new layers, check Prompt for CRS. Then you will be asked for the CRS during import. It looks like the plugin does not set the CRS correctly from your input, but uses a default of EPSG:4326.
    – AndreJ
    Commented Aug 25, 2014 at 10:32

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.