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).

  • So you want the points layer to have a new column indicating for each point whether it is the start or end point of the line it was created from? – Jake Nov 27 '13 at 22:18
  • If you import your line shapefile into a Spatialite DB, it's easy to use the functions StartPoint() and EndPoints() to get those. – Micha Nov 28 '13 at 6:33
  • Are you interested in getting a point layer or do you just want the coordinates of the start and end point? – underdark Nov 28 '13 at 17:47
  • Jake, Yes. Mika, I want to keep it in shapefile format. Underdark, my final goal is to have a point layer. – GreyHippo Dec 2 '13 at 12:32
  • I read the link (grass.osgeo.org/grass64/manuals/v.to.db.html) but I am unable to find this command in Qgis Processing – GreyHippo Dec 2 '13 at 14:52

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.

| improve this answer | |

I have no idea why this question has suddenly reappeared but it is now quite an easy task:

If you wanted to work entirely within QGIS (rather than in a database as suggested in the older comments) then the Qchainage plugin will output start and end points with their respective chainage, plus the FID of the line they're associated with. An easy task then to add a new column and use a CASE statement to determine whether a point is a start point (chainage 0) or an end point (chainage >0)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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