[GIS] How to convert lines to start and end points

qgisshapefile

I know there are several ways to convert lines to points in QGIS but I have not been able to find a solution that will convert the file so that it indicates if the point is the start point (upstream) or end point (downstream).

Best Answer

Since QGIS 3, there is an algorithm called Extract specific vertices. If you specify 0,-1 as parameter, you obtain the start and end points for each line. Extract specific vertices

You can find this algorithm in the Processing Toolbox. More info here.

For your case, you could first extract start vertices (parameter 0) and add an attribute/column with value start for every feature. Then do the same for end vertices (parameter -1 and value end) and merge both layers. The line's attributes will be carried over to the new point layers, so (assuming the lines layer has an ID column) it is possible to see what line the point is a start or end point of and whether it is a start or an end point.

If you want to find all vertices instead of just end points, use the Extract vertices algorithm.

Related Question