7

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

@geometry_point_num

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.

BTL
  • 155
  • 7

2 Answers2

6

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

Babel
  • 71,072
  • 14
  • 78
  • 208
1

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.

GBG
  • 9,737
  • 1
  • 15
  • 44