3

I have a shapefile with 2 points.

I am using the XY to Line tool in the ShapeTools plugin to create a Geodesic, Great Circle, and Simple Line. However, in each case, the tool is running successfully, but producing empty outputs.

The following screenshots shows the parameters:

enter image description here

The straight line connecting the 2 points is getting successfully created if I use the Points to Path tool.

The aim of this exercise is to be able to see the difference in geodetic distance and Euclidean distance. I also want to show how the projection of the geodetic line connecting the two points look like on a flat map.

If I do not check the optional check boxes, Use the point geometry for the line starting point and Use the point geometry for the line ending point, the tool show the error Please select valid starting and ending point columns.

I am using QGIS 3.4.1

6
  • You seem to have checked both 'Use point geometry for the line starting/ending point'. Does your source layer contain point or line features? Or attributes for start/end points?
    – FSimardGIS
    Nov 14, 2018 at 22:35
  • @FSimardGIS : My shapefile has just 2 points which are meant to be the start and end points. The order does not matter.
    – DotPi
    Nov 15, 2018 at 6:04
  • I believe this tool is meant to work with 1 feature > 1 line, not 2 features > 1 line. In other words, try to include all the info (start/end x/y fields) in one single record per line that you want to create.
    – FSimardGIS
    Nov 16, 2018 at 0:44
  • @FSimardGIS: I understand that having both the start and the end point in the same column is possible when the data is in a table, but how is that permissible in a shapefile? The tool takes as input a shapefile.
    – DotPi
    Nov 16, 2018 at 0:59
  • The tool help states the following : 'One of the coordinates can be from a point layer geometry', so I don't think it can work with 2. You can only use it for one of the coordinates
    – FSimardGIS
    Nov 16, 2018 at 1:07

1 Answer 1

1

You seem to have checked both 'Use point geometry for the line starting/ending point'. However, this tool is meant to work with 1 feature > 1 line, not 2 features > 1 line. Try to include all the info (start/end x/y fields) in one single record per line that you want to create.

The tool help states the following : 'One of the coordinates can be from a point layer geometry', so you can only use a point geometry for one of the coordinates, and the other coordinate pair would have to be in 2 fields (x/y) in the table.

1
  • Adding text from previous comment here for clarity: Your suggestion worked. I made a csv file with the start and end coordinate in the same row, imported that csv, and in the tool explicitly told which columns had the start and end coordinates.
    – DotPi
    Nov 16, 2018 at 1:16

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.