In QGIS 3.4.8 I can label vertices with their vertex number by using the following expression for a Font marker symbol:


But, the expression only seems to count the vertices within the current view - so as I zoom in and out the numbers change.

Is there a way to make this work for each whole polyline, irrespective of the view, so the numbers do not change? So I can, for example, zoom into a line and know I am looking at the fifth vertex along the line.


For me, what you want works with the expression @geometry_part_num . In the layer-styling, I set the style to be rendered by geometry-generator with the expression nodes_to_points( $geometry). As a marker, I select Font-marker and at the selection of the symbol, I select data-driven override with the expression @geometry_part_num


You could extract the vertices of the line as point using the extract nodes tool. And the point to your project. Add a new attribute to the table with a sequence of numbers. Label those points using the sequence.

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.