Monday, 24 July 2017

qgis - Connecting waypoint pairs and calculating length?


I want to make a path out of points and calculate the distances of each single line. I have a point layer with waypoints of a research vessel. The way points have in the attribute table a date and a time and are labeled either as on effort or as off effort. Now I want to make a line layer with a path from point to point according to the recorded time. This line layer should have the information about the associated waypoints in the attribute table. I that line layer I want to calculate the distances from one waypoint to the next in the attribute table.


I have tried the extensions "points to path" and "points2one", but in both cases I only got one polyline. That is not suitable for me, because for further calculations I have to neglect the distances between off effort waypoints.


In ArcView it works with the extension "Path with distances and bearings". Is there a way I can solve this in QGIS?


This is how the point layer attribute table looks like: original attribute table


This is how the attribute layer of the line layer should look like: resulting attribute table


I am using QGIS 1.8.0 on a Mac OSX 10.6.8



Answer



I ended up making a WKT code for lines in excel looking like that: LINESTRING(Long Lat, Long Lat). As starting coordinates I have used the Long and Lat of the same raw and for the ending coordinates the Long and Lat of the next raw. Then imported it as tab delimited text, ticked WKT, and done.



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...