Footpath Chainages

35 views
Skip to first unread message

Mark Arnup

unread,
Nov 21, 2021, 10:44:55 PM11/21/21
to QGIS Australia User Group

Dear All.

I have a layer for my footpaths, with separate line segments (with its own ID numbers) as well as a start and finish chainage listed against each line segment in its attributes.

What I’m wishing to do, is create chainage points along each line segment with the first point not being “0” as the QChainage plugin does, but the start chainage as listed in the attribute table for that (and each) line segment!

Is there a quick and easy way that I can do this?

Andrew Jeffrey

unread,
Nov 21, 2021, 11:27:54 PM11/21/21
to Australian and New Zealand QGIS User Group

Hi Mark,


I can’t think of a tool that does exactly that, as I don’t do much chainage based work. But if I understand your situation there should only be two chainage points per line. Assuming the line is digitised in the direction of increasing chainage then you could use the “Extract vertices” tool and a field calculator expression to get the result.


Extract vertices (Vector > Geometry Tools > Extract Vertices) on a line layer that has a start and end chainage value gives me this.



I have added a new field to that table called “chainage” which will hold my chainage value to label by as you can see the "Extract Vertices" tool give each point the same attribution from the parent dataset. However, using the following expression I can calculate the chainage value for each point based on the “vertex_index” above. I have attached the expression that I used in the expression builder as a text file.



Update all values and you should have a result in your new change column.

Should get you close I would think - I can see problems if end chainages from some segments overlap with start chainages from others. But you could handle the label conflicting with some good label placement rules.


Good Luck

Andrew


--
You received this message because you are subscribed to the Google Groups "QGIS Australia User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to australian-qgis-use...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/australian-qgis-user-group/44184f73-e318-4779-8e77-c3c50308f445n%40googlegroups.com.
expression.txt
Reply all
Reply to author
Forward
0 new messages